--- id: unittest-xml-reporting version: "4.0.0" license: BSD-2-Clause license_treatment: permissive maintenance: aging --- # unittest-xml-reporting — unittest-based test runner with Ant/JUnit like XML reporting. License: permissive · Maintenance: aging · Downloads: 8.4M/mo ## What it is and what it does unittest-xml-reporting is a test runner for Python's built-in unittest framework that captures test results and writes them to XML files in xUnit format. It integrates directly into your test execution pipeline by replacing the default test runner, and outputs structured reports that tools like build systems and continuous integration servers can parse and display. The package depends only on lxml for XML generation. You use it by instantiating XMLTestRunner in place of the standard unittest runner, pointing it to an output directory or file. It supports command-line discovery and doctest reporting. The XML output follows the xUnit schema, though the package notes that sub-test reporting has limited granularity because xUnit schemas do not map well to unittest's sub-test concept. Use it for: - Export unittest results to XML for continuous integration servers to parse and display test metrics. - Generate structured test reports that build systems and IDEs can consume to show test pass/fail status. - Run doctests through the test runner to produce xUnit-compatible reports. - Integrate with Django test runners by setting TEST_RUNNER to the package's Django test runner. - Capture test results to memory or file for post-processing or archival in automated test pipelines. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A unittest test runner that exports test results to XML files in xUnit format, compatible with build systems, IDEs, and continuous integration servers. Yes. The package is stable (Production/Stable status), has no known vulnerabilities, requires only one lightweight dependency (lxml), and solves a concrete problem—converting unittest results to xUnit XML—that CI/CD pipelines and test aggregators expect. Aging maintenance (219 days since last release) is a minor concern but not a blocker given the package's narrow, mature scope. Install it if you need xUnit-compatible test reports. ## Install pip install unittest-xml-reporting uv add unittest-xml-reporting poetry add unittest-xml-reporting ## Installing unittest-xml-reporting Before you install: Low install friction with a single runtime dependency (lxml). Maintenance status is aging—last release was 219 days ago—but the repository remains active with recent commits and no archived status. License in practice: BSD-2-Clause is a permissive license; you may use, modify, and distribute this package with minimal restrictions, provided you retain the license notice. Quickstart: pip install unittest-xml-reporting import unittest if __name__ == '__main__': unittest.main( testRunner=XMLTestRunner(output='test-reports'), failfast=False, buffer=False, catchbreak=False) Requires Python 3.10 or later; lxml is installed as a runtime dependency. Verify before relying: - Whether the package's limited support for unittest.TestCase.subTest affects your test suite's reporting granularity. - Compatibility with specific CI/CD systems beyond Jenkins xUnit plugin versions 1.100 and 1.104+. - Whether the package maintains backward compatibility with older xUnit schemas. ## Package facts - License: BSD-2-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 8.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags unittest xml reporting, xunit test runner, junit xml output, ci test reports, test result xml export, xmlrunner, unittest xml formatter, test-reporting, ci-integration, xml-output [View on SkillFed](https://skillfed.io/packages/unittest-xml-reporting) · [View on PyPI](https://pypi.org/project/unittest-xml-reporting/)