skillfed

pytest-nunit

A pytest plugin for generating NUnit3 test result XML output

pytest-nunit v1.0.7 629.1K downloads/30d#5,670 on PyPI10
Permissive license MIT License DORMANT released

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

uv

uv add pytest-nunit

poetry

poetry add pytest-nunit

Installing 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

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Tags

pytest nunit xml outputtest result xml generationazure pipelines test reportingnunit3 xml pytest plugintest report xml formatpytest test results exportci/cd test result publishing
ci-cd-integrationtest-reporting

More Testing packages