Registry / testing / xunitparserx

xunitparserx

JSON →
library1.9.12pypypi✓ verified 83d ago

Read JUnit/XUnit/MSTest XML files and map them to Python objects. Current version 1.9.12, released irregularly.

pip install xunitparserx
INSTALL
IMPORT
SIG · XUNITPARSERX
X
xunitparserx
testingpythonv1.9.12
Install
3.3s avg
Import
205ms
Disk
41MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.9.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.228s · 42.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.3s · import 0.182s · 43MB
41MB installed
● package 41MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
from xunitparserx import parse
TestSuite
from xunitparserx import TestSuite

Basic usage: parse an XUnit XML file and iterate over test cases.

from xunitparserx import parse # Parse an XUnit XML file with open('results.xml', 'r') as f: suite, report = parse(f) # Access test suite info print(f"Tests: {suite.tests}, Failures: {suite.failures}, Errors: {suite.errors}") # Iterate over test cases for test in suite.test_cases(): print(f"{test.classname}.{test.methodname}: {test.result}")
Debug
Known issues
gotchaThe parse function returns a tuple (suite, report). The 'report' object may be None if not parsing a report-style XML.
fix
Always accept both: suite, report = parse(...). Check report for None if needed.
affects: all
gotchaThe library expects well-formed XML per JUnit/XUnit schema. Malformed or non-standard XML may cause parse errors or missing attributes.
fix
Validate XML against the schema before parsing. Use lxml or xml.etree for pre-validation.
affects: all
deprecatedOlder versions used methodnames like 'test.classname' and 'test.methodname'; these have been replaced by 'test.classname' and 'test.methodname' (same). Check if your version uses 'test.classname' or 'test.classname'.
fix
Use 'test.classname' and 'test.methodname' (they remain consistent).
affects: <1.5.0
Errors
Common errors & fixes
ImportError: No module named xunitparserx
Package not installed or environment missing.
fix
Run 'pip install xunitparserx'.
AttributeError: 'str' object has no attribute 'iterparse'
Passing a file path string instead of a file object to parse().
fix
Open the file first: with open('file.xml') as f: suite, report = parse(f)
Upgrade
Version history
1.9.12latest on PyPI · released Jan 14, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
34
Bingbot
1
OpenAI (training)
1
Resources
xunitparserx — pip install xunitparserx · libregistry