pytest

What is the expected behavior of a fixture which has been overriden by parametrized fixture in pytest?


Given a fixture that has been overridden.

What would be if there are a chain of parametrized fixtures? For example:

@pytest.fixture(scope="module", params=["module1", "module2"])
test_fixture(request)
...

@pytest.fixture(scope="class", params=["class1", "class2"])
test_fixture(request, test_function):
request.param -?

...
@pytest.fixture(scope="function")
test_fixture(request, test_fixture):
request.param -?

What params of test_fixture is supposed to be in the function scope fixture? What is the expected behavior? I could not find this question in the docs.


Solution

  • The behavior is that class1, class2