pytest
pytest copied to clipboard
The teardown does not execute properly for session level fixture when we use --reruns
When you will run the "test_example_fixture" test, You will observe that the teardown is never printed in console. This is restricting the clean up in my project.
NOTE: It happens only when we use rerun failed tests.
import pytest
@pytest.fixture(scope="session") def example_fixture(): print("\nSetup") yield print("Teardown")
@pytest.mark.flaky(reruns=1) def test_example_fixture(example_fixture): assert 0
I am using pytest 8.2 and pytest-rerunfailures 14.0
Please provide details on what command you run
Running directly using pycharm.
Fyi it works in pytest 8.1.0
Also, I have tested this it works on pytest 8.1.0 but not in 8.2.0. With pytest-rerunfailures 14.0 or 12.0
This issue is stale because it has the status: needs information label and requested follow-up information was not provided for 14 days.