Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible with pytest-rerunfailures #79

Open
david-vankampen opened this issue Mar 22, 2024 · 0 comments
Open

incompatible with pytest-rerunfailures #79

david-vankampen opened this issue Mar 22, 2024 · 0 comments

Comments

@david-vankampen
Copy link

During testing of pytest-azurepipelines, which relies on pytest-nunit, it was found that if you have pytest-rerunfailures installed and use the reruns argument, then this plugin's self.nunit_xml.cases becomes empty, so the add attachment fixture raises a KeyError exception.

Minimal example:

def test_example(add_nunit_attachment):
    add_nunit_attachment("test_minimal.py", "test attachment")

And if you run this command:

pytest --nunit-xml=test-results.xml

then it will generate the report with attachment details as expected.

However, if you pip install pytest-rerunfailures, and then run:

pytest --nunit-xml=test-results.xml --reruns 0

then you get KeyError: 'test_minimal.py::test_example'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant