How to parametrize parameters to fixtures and parametrize test functions #12548
Replies: 1 comment
-
see https://docs.pytest.org/en/stable/example/parametrize.html#indirect-parametrization |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm trying to build test that use a fixtures and also get parametrize and want to pass a parameter to a fixture also.
Both of the parametrize the common parameter. (var1 and var2).
One way is:
But now the test will run more times them needed.
Is there a way, with only one @pytest.mark.parametrize?
something like this:
@pytest.mark.parametrize('tester, 'param1,', [('var1', 'someVal1'), ('var2', 'someVal2')], indirect=True)
Only in this way the fixture is receiving more them one request.param.
Thanks for the help :)
Beta Was this translation helpful? Give feedback.
All reactions