allure-framework / allure-python

Allure integrations for Python test frameworks
https://allurereport.org/
Apache License 2.0
719 stars 235 forks source link

Fix squashed results when using rerunfailures (fixes #735) #736

Closed delatrie closed 1 year ago

delatrie commented 1 year ago

Context

This PR fixes the regression when pytest-rerunfailures is used. The issue started to occur after the closing of a test result was moved from pytest_runtest_logfinish to pytest_runtest_protocol to prevent the test result from being omitted from the output under certain conditions (e.g., if pytest.exit was called during fixture setup).

To fix that, I put the closing of a test result back to pytest_runtest_logfinish while still backing it up with pytest_runtest_protocol in case pytest_runtest_logfinish is not called. These two closings should cover both issues.

Fixes #735.

Checklist