{"library":"pytest-nunit","title":"pytest-nunit","description":"pytest-nunit is a pytest plugin for generating NUnit3 test result XML output. It integrates seamlessly with `pytest` to produce reports compatible with NUnit test runners. The project is actively maintained with frequent updates, including recent support for `pytest` 8 and ongoing compatibility improvements.","language":"python","status":"active","last_verified":"Mon Apr 13","install":{"commands":["pip install pytest-nunit"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pytest\n\n# Create a dummy test file, e.g., test_example.py\nwith open('test_example.py', 'w') as f:\n    f.write('def test_success():\\n    assert True\\n\\ndef test_failure():\\n    assert False\\n')\n\n# Run pytest with nunitxml output\n# This will generate a 'test-results.xml' file in the current directory\npytest.main(['test_example.py', '--nunit-xml=test-results.xml'])\n\n# Clean up (optional)\nimport os\nos.remove('test_example.py')\nos.remove('test-results.xml')","lang":"python","description":"To use `pytest-nunit`, simply install the package. It integrates automatically with `pytest`. You can then generate an NUnit XML report by running `pytest` with the `--nunit-xml` option, specifying the desired output file path. This example demonstrates running tests and generating an XML report named `test-results.xml`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}