{"id":24855,"library":"xunitparserx","title":"xunitparserx","description":"Read JUnit/XUnit/MSTest XML files and map them to Python objects. Current version 1.9.12, released irregularly.","status":"active","version":"1.9.12","language":"python","source_language":"en","source_url":"https://github.com/medlab/xunitparserx","tags":["xml","xunit","junit","test","parsing"],"install":[{"cmd":"pip install xunitparserx","lang":"bash","label":"pip install"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"parse","correct":"from xunitparserx import parse"},{"note":"","wrong":null,"symbol":"TestSuite","correct":"from xunitparserx import TestSuite"}],"quickstart":{"code":"from xunitparserx import parse\n\n# Parse an XUnit XML file\nwith open('results.xml', 'r') as f:\n    suite, report = parse(f)\n\n# Access test suite info\nprint(f\"Tests: {suite.tests}, Failures: {suite.failures}, Errors: {suite.errors}\")\n\n# Iterate over test cases\nfor test in suite.test_cases():\n    print(f\"{test.classname}.{test.methodname}: {test.result}\")","lang":"python","description":"Basic usage: parse an XUnit XML file and iterate over test cases."},"warnings":[{"fix":"Always accept both: suite, report = parse(...). Check report for None if needed.","message":"The parse function returns a tuple (suite, report). The 'report' object may be None if not parsing a report-style XML.","severity":"gotcha","affected_versions":"all"},{"fix":"Validate XML against the schema before parsing. Use lxml or xml.etree for pre-validation.","message":"The library expects well-formed XML per JUnit/XUnit schema. Malformed or non-standard XML may cause parse errors or missing attributes.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'test.classname' and 'test.methodname' (they remain consistent).","message":"Older 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'.","severity":"deprecated","affected_versions":"<1.5.0"}],"env_vars":null,"search_vec":"'1.9.12':14 'current':12 'file':5 'irregular':16 'junit':19 'junit/xunit/mstest':3 'map':7 'object':11 'pars':21 'python':10 'read':2 'releas':15 'test':20 'version':13 'xml':4,17 'xunit':18 'xunitparserx':1","created_at":"2026-05-01T08:15:16.217107+00:00","updated_at":"2026-05-01T08:15:16.217107+00:00","problems":[{"fix":"Run 'pip install xunitparserx'.","cause":"Package not installed or environment missing.","error":"ImportError: No module named xunitparserx"},{"fix":"Open the file first: with open('file.xml') as f: suite, report = parse(f)","cause":"Passing a file path string instead of a file object to parse().","error":"AttributeError: 'str' object has no attribute 'iterparse'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.9.12","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/medlab/xunitparserx","docs":null,"changelog":null,"pypi":"https://pypi.org/project/xunitparserx/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}