Skip to content

Use a simple with statement to capture information for XUnit tests

License

Notifications You must be signed in to change notification settings

TAMU-CPT/xunit-python-decorator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xunit-python-decorator

Easily decorate python functions with a with statement.

Turn

import time

start = time.time()
try:
    # your code
    1 / 0
except Exception, e:
    errMsg = str(e)
    errTb = traceback...

end = time.time()
# add xunit test case with formatted error string + timing data

into

with xunit('name', 'tests.') as tc1:
    1 / 0

ts = xunit_suite('My Suite', [tc1])
print(xunit_dump([ts]))

LICENSE

GPL-3.0

About

Use a simple with statement to capture information for XUnit tests

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages