The answer to how to override a fixture with parametrization is already given here: pytest test parameterization override
My question is what is the correct way to run the same test, both with the original fixture and the overridden values.
I'm already using the pytest-lazy-fixture library to override one fixture with another, but when I run the following pytest:
import pytest
from pytest_lazyfixture import lazy_fixture
@pytest.fixture
def fixture_value():
return 0
def test_foo(fixture_value):
...
@pytest.mark.parametrize('fixture_value', (lazy_fixture('fixture_value'), 1, 2, 3))
def test_bar(fixture_value):
...
I get this error:
E recursive dependency involving fixture 'fixture_value' detected