Description
xunitparser reads a JUnit/XUnit XML file and maps it to Python objects. It tries to use the objects available in the standard unittest module.
Usage
import xunitparser
ts, tr = xunitparser.parse(open('/path/to/unit.xml'))
ts is a TestSuite class, containing TestCase classes. tr is a TestResult class.
You can change the classes used (though they probably would not work unless they inherit from the xunitparser ones) by using your own xunitparser.Parser class and changing the *_CLASS variables.
Some helpful properties are added to the TestCase class:
for tc in ts:
print('Class %s, method %s' % (tc.classname, tc.methodname))
if tc.good:
print('went well...', 'but did not run.' if tc.skip else '')
else:
print('went wrong.')
For more, please read the source code - it is very minimal. The classes also inherit from the unittest module so it is actually a good reference of what you can do with xunitparser.
Changes
1.3.4
fix python 3 compatibility
main project URL change as maintainer changes
1.3.0
Multiple results in a single TestCase are seen as one. The previous way was never validated by real-life examples.
Handle system-out / system-err at the testsuite level
Development
Contributions can be sent to https://gitlab.com/woob/xunitparser/
Metadata
Release files for xunitparser 1.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xunitparser-1.3.4.tar.gz | 15.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xunitparser-1.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / xunitparser-1.3.4.tar.gz
| Download URL | xunitparser-1.3.4.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce6f4319f9a33ddd3ef379109814f9ae2d18921afe9bc0a73caf827362bf8a02
|
|
BLAKE2b-256 checksum How to use checksums |
8f8ca46db142d14971a770fd126021194b9c88c92558c23e5911c469bce495e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|
Release files / xunitparser-1.3.4-py3-none-any.whl
| Download URL | xunitparser-1.3.4-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20136a960d62c61af4b257f94dd5497da88b4021bb5f017e623fce6379ca972e
|
|
BLAKE2b-256 checksum How to use checksums |
e52a6010fbe06d7a32a040eb5d0987a137f3b3b5e8d0792487a29625fb4ba4fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|
Security for xunitparser 1.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.