Skip to main content

A pytest plugin for generating Nunit3 test result XML output

Project description

Build status PyPI version Python versions PyPI download month

A pytest plugin for generating Nunit3 test result XML output

This plugin is an early alpha release!

Configuration

Use --nunit-xml=output.xml to create an Nunit3-compatible file called output.xml

Fixtures

The following fixtures are made available by this plugin.

record_nunit_property

Calling record_nunit_property(key: str, value: str) will result in Property tags being added to the test-case for the related node.

def test_basic(record_nunit_property):
    record_nunit_property("test", "value")
    assert 1 == 1

add_nunit_attachment

Add an attachment to a node test-case by calling the add_nunit_attachment() function with the filepath and a description.

def test_attachment(add_nunit_attachment):
    pth = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'fixture.gif')
    add_nunit_attachment(path, "peanut butter jelly time")
    assert 1 == 1

Usage with Azure Pipelines

Add the following steps to your build job to publish the results to Azure Pipelines:

- script: "pip install pytest-nunit"

- script: |
    python -m pytest tests -v --nunit-xml=test-results-integration.xml
  continueOnError: true

- task: PublishTestResults@2
  inputs:
    testResultsFormat: NUnit
    testResultsFiles: '**/test-results*.xml'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-nunit-0.0.6.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

pytest_nunit-0.0.6-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file pytest-nunit-0.0.6.tar.gz.

File metadata

  • Download URL: pytest-nunit-0.0.6.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for pytest-nunit-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6ab9069a357ff0c84a4de2fd482eba566501659933c26c9e5116dc47cbe93a88
MD5 822bf73b33d10e325d0f593df7458348
BLAKE2b-256 16ac4bc0f415cd0cd73a5592b6c6721f5043d8211711c6be6a0103cd77f2b65c

See more details on using hashes here.

File details

Details for the file pytest_nunit-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: pytest_nunit-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for pytest_nunit-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8751ed12f99f3a73815dceb10ba426e5f2ae3356bf85601863a9e7c48f8a509d
MD5 1a12777b7a12979d77a9b528d61e33ec
BLAKE2b-256 9502b451d1420fcb4e14efdef29b60c08229a4c0d31b2c5fbfffecc8067bfd9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page