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.

Files for xunit-wrapper, version 0.11
Filename, size File type Python version Upload date Hashes
Filename, size xunit_wrapper-0.11-py2.7.egg (3.2 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size xunit_wrapper-0.11-py3.5.egg (3.4 kB) File type Egg Python version 3.5 Upload date Hashes View
Filename, size xunit_wrapper-0.11.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page