Skip to content

incompatible with pytest-rerunfailures #79

@david-vankampen

Description

@david-vankampen

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions