Skip to content

Commit 46c2842

Browse files
committed
Adding support for lazy-fixture-parametrized fixtures as subfixtures (making test_lazy_fixtures_in_subfixture succeed)
1 parent bb64331 commit 46c2842

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pytest_lazyfixture.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ def fill(request):
4141
return fill
4242

4343

44+
@pytest.hookimpl(tryfirst=True)
45+
def pytest_fixture_setup(fixturedef, request):
46+
val = getattr(request, 'param', None)
47+
if is_lazy_fixture(val):
48+
request.param = request.getfixturevalue(val.name)
49+
50+
4451
def pytest_runtest_call(item):
4552
if hasattr(item, 'funcargs'):
4653
for arg, val in item.funcargs.items():

0 commit comments

Comments
 (0)