Skip to main content

Wrap python functions with a decorator to handle building XUnit reports

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xunit_wrapper-0.11.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distributions

xunit_wrapper-0.11-py3.5.egg (3.4 kB view hashes)

Uploaded Source

xunit_wrapper-0.11-py2.7.egg (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page