pytest-nunit
A pytest plugin for generating NUnit3 test result XML output
What it is and what it does
pytest-nunit is a pytest plugin that converts test results into NUnit3-format XML output, primarily for integration with CI/CD systems like Azure Pipelines. It runs as part of your normal pytest invocation and generates an XML file containing test outcomes, properties, attachments, and failure details.
The plugin provides command-line options to specify the output file path and test name prefix, plus INI configuration for including system metadata and controlling attachment behavior. It exposes two fixtures—record_nunit_property and add_nunit_attachment—that let individual tests add custom properties and file attachments to their NUnit records. It handles skipped tests, xfails, and xpasses with appropriate XML representation.
Use it for:
- Publishing pytest results to Azure Pipelines using the NUnit test result format.
- Generating machine-readable test reports for CI/CD systems that consume NUnit XML.
- Attaching logs, screenshots, or other artifacts to individual test cases in the XML output.
- Recording custom metadata (properties) on test cases for downstream analysis or filtering.
- Integrating pytest into enterprise test management systems that expect NUnit format.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that generates NUnit3-format XML test result reports, enabling integration with test result publishing systems like Azure Pipelines.
Yes, if you need NUnit3 XML output for Azure Pipelines or another system that consumes that format. The package is stable and has no known vulnerabilities, but its dormant status (no updates in 900 days) means you should verify compatibility with your current Pytest version before relying on it in production. For simple test reporting, consider whether a more actively maintained alternative exists.
Install
pytest-nunit on PyPI
pip
pip install pytest-nunituv
uv add pytest-nunitpoetry
poetry add pytest-nunitInstalling pytest-nunit
Before you install
High install friction due to being a standalone archive distribution. The package is dormant—last release was 900 days ago—but remains marked Production/Stable and supports current Python versions including 3.10, 3.11, and 3.12.
License in practice
MIT License (permissive) places no restrictions on use, modification, or redistribution in proprietary or open-source projects.
Quickstart
pip install pytest-nunit
pytest tests/ --nunit-xml=results.xml
# In a test file:
def test_example(record_nunit_property):
record_nunit_property("key", "value")
assert True
Requires Python 3.6+ and Pytest 5.1.0+; the package is dormant and may have compatibility issues with very recent pytest versions.
Verify before relying
- Whether the package remains compatible with Pytest versions released after February 2024.
- Whether high install friction (tar.gz distribution) reflects current packaging or a historical artifact.
- Current maintenance status and responsiveness to bug reports or pull requests.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 900 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 629,105/month — #5,670 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest-nunit-1.0.7.tar.gz
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
pytest-azurepipelinesA pytest plugin that automatically formats test…
permissive · top 5,000 on PyPI
pytest-htmlGenerates HTML reports for pytest test results,…
copyleft · top 1,000 on PyPI
pytest-custom-reportA pytest plugin that lets you customize the…
permissive · top 15,000 on PyPI
pytest-pspecFormats pytest test output in RSpec-style…
permissive · top 15,000 on PyPI
pytest-excelA pytest plugin that generates Excel reports…
permissive · top 15,000 on PyPI
pytest-md-reportA pytest plugin that generates test outcome…
permissive · top 15,000 on PyPI
pylint-junitGenerates JUnit-formatted XML reports from…
permissive · top 15,000 on PyPI
pytest-runtime-xfailA pytest plugin that provides a `runtime_xfail`…
permissive · top 15,000 on PyPI
junit-xml-2Generates JUnit XML test result reports from…
permissive · top 15,000 on PyPI