VQ
import pytest
from pytest_lazyfixture import lazy_fixture
@pytest.fixture(params=['a', 'b', 'c'])
def one():
print('one')
return 1
@pytest.fixture(params=['z', 'y'])
def two():
print('two')
return 2
@pytest.fixture(params=[lazy_fixture('one'), lazy_fixture('two')])
def common_fixture(request):
return request.param
def test(common_fixture):
print(common_fixture)
lazy_fixture/test_5pytest_lazy_fixture_with_params.py::test[one-a] one
1
PASSED
lazy_fixture/test_5pytest_lazy_fixture_with_params.py::test[one-b] one
1
PASSED
lazy_fixture/test_5pytest_lazy_fixture_with_params.py::test[one-c] one
1
PASSED
lazy_fixture/test_5pytest_lazy_fixture_with_params.py::test[two-z] two
2
PASSED
lazy_fixture/test_5pytest_lazy_fixture_with_params.py::test[two-y] two
2
PASSED
https://github.com/TvoroG/pytest-lazy-fixture/blob/master/tests/test_lazyfixture.py - тут наверняка найдётся подходящий пример

