skillfed

unittest-xml-reporting

unittest-based test runner with Ant/JUnit like XML reporting.

unittest-xml-reporting v4.0.0 8.4M downloads/30d#1,624 on PyPI307
Permissive license BSD-2-Clause AGING released

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 on this page — 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

unittest-xml-reporting on PyPI

pip

pip install unittest-xml-reporting

uv

uv add unittest-xml-reporting

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — lxml
Maintenance aging — 219 days since the last release
Last repo commit
First released
Downloads 8,416,842/month — #1,624 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: unittest_xml_reporting-4.0.0-py2.py3-none-any.whl

Keywords: pyunit, unittest, junit xml, xunit, report, testrunner, xmlrunner

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Testing

Tags

unittest xml reportingxunit test runnerjunit xml outputci test reportstest result xml exportxmlrunnerunittest xml formatter
test-reportingci-integrationxml-output

More Python Modules packages