skillfed

junit-xml

Creates JUnit XML test result documents that can be read by tools such as Jenkins

junit-xml v1.9 12.8M downloads/30d#1,305 on PyPI123
Permissive license MIT DORMANT released

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-xml

uv

uv add junit-xml

poetry

poetry add junit-xml

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: Freely DistributableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Build ToolsTopic :: Software Development :: Testing

Tags

junit xml test reportsjenkins test result xmlpython test reportingbamboo xml outputci test result formattest suite xml generation
ci-cd-integrationtest-reporting

More Testing packages