junit-xml
Creates JUnit XML test result documents that can be read by tools such as Jenkins
What it is and what it does
junit-xml is a Python library that serializes test results into JUnit XML format, the de facto standard for test reporting in CI/CD platforms like Jenkins and Bamboo. It provides TestSuite and TestCase classes that you populate with test metadata (name, class, duration, stdout, stderr) and then export to XML via to_xml_string() or to_file()—the library handles formatting, pretty-printing, and automatic stripping of illegal XML characters.
The package is a thin, focused tool: it does not run tests or integrate with test frameworks directly, but rather accepts test result data and produces the XML that CI systems consume to generate dashboards and reports. It has one runtime dependency (six) and installs with low friction. While maintenance is dormant (last release 2020-02-22), the package is marked Production/Stable and widely deployed.
Use it for:
- Export test results from a custom Python test runner to Jenkins for visualization and trend tracking.
- Generate JUnit XML from test runs to feed into Bamboo CI pipelines.
- Produce machine-readable test reports from a Python test suite for integration with CI/CD systems.
- Batch-convert test results from multiple Python test tools into a standardized format for aggregated reporting.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates JUnit XML test result documents compatible with Jenkins and Bamboo, allowing Python test suites to produce machine-readable reports for CI/CD systems.
Yes, if you need to export Python test results to Jenkins, Bamboo, or any CI system that consumes JUnit XML. The package is stable, permissively licensed, and has minimal dependencies. Be aware that maintenance is dormant; if your CI platform changes its XML schema expectations, you may need to fork or patch the library yourself. For standard use cases, it remains a reliable choice.
Install
junit-xml on PyPI
pip
pip install junit-xmluv
uv add junit-xmlpoetry
poetry add junit-xmlInstalling junit-xml
Before you install
Low install friction with a single lightweight dependency (six). Maintenance is dormant—last release was 2020-02-22 and no commits since 2023-12-20—but the package is marked Production/Stable and has accumulated substantial adoption.
License in practice
MIT license (permissive) imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install junit-xml
from junit_xml import TestSuite, TestCase
test_cases = [TestCase('Test1', 'some.class.name', 123.345, 'stdout', 'stderr')]
ts = TestSuite("my suite", test_cases)
print(TestSuite.to_xml_string([ts]))
Verify before relying
- Whether dormant maintenance status poses a risk if Jenkins or Bamboo XML schema requirements change.
- Current compatibility with modern Python versions beyond what classifiers declare.
- Whether the package remains compatible with current versions of Jenkins and Bamboo.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | dormant — 2,365 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,784,944/month — #1,305 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: junit_xml-1.9-py2.py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
junit-xml-2Generates JUnit XML test result reports from…
permissive · top 15,000 on PyPI
pylint-junitGenerates JUnit-formatted XML reports from…
permissive · top 15,000 on PyPI
junitparserParse, create, and manipulate JUnit/xUnit test…
permissive · top 5,000 on PyPI
flake8-formatter-junit-xmlFormats flake8 linting output as JUnit XML,…
permissive · top 15,000 on PyPI
xunitparserParses JUnit/XUnit XML test result files and…
permissive · top 15,000 on PyPI
junit2htmlConverts JUnit or XUnit XML test result files…
permissive · top 5,000 on PyPI
xmlrunnerA unittest test runner that exports test…
copyleft · top 15,000 on PyPI
flake8-junit-reportConverts flake8 linting output to JUnit XML…
permissive · top 15,000 on PyPI
flake8-junit-report-basicConverts flake8 linting output to JUnit XML…
permissive · top 5,000 on PyPI
codecovUploads Python code coverage reports to…
permissive · top 5,000 on PyPI