Skip to content

broken test with reruns plugin #64

@phnmn

Description

@phnmn

When test runs with reruns pytest plugin (eg pytest-rerunfailures) failed test will become broken with "already stored" error:

E               KeyError: "Internal Error - This fixture 'database' was already stored for test id 'test_rerun_harvets.py::test_database'"

example of test_rerun_harvets.py

import pytest
from pytest_harvest import saved_fixture

@pytest.fixture
@saved_fixture
def database():
    return "postgresql"


def test_database(database):
    assert database == "clickhouse"

and run test with 2 reruns

python -m pytest --reruns 2 test_rerun_harvets.py

installed deps:

decopatch==1.4.10
exceptiongroup==1.1.3
iniconfig==2.0.0
makefun==1.15.1
packaging==23.2
pluggy==1.3.0
pytest==7.4.2
pytest-harvest==1.10.4
pytest-rerunfailures==12.0
six==1.16.0
tomli==2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions