You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started giving more and more pytest trainings recently, and noticed a confusion almost everyone stumbles over when using parametrize the first time. Many people accidentally write:
i.e. they use "arg1", "arg2" instead of "arg1, arg2" or ("arg1", "arg2") for parametrize. This results in:
In test_parametrization: indirect fixture '(1, 1)' doesn't exist
which is an error message which will confuse newcomers even more (they probably have no idea what an indirect fixture is supposed to be at this point).
We should really try to somehow improve that message, maybe be suggesting the right usage?
The text was updated successfully, but these errors were encountered:
I guess we could validate that indirect is really of the expected type (either a bool or a list of strings) - but maybe we should deprecate calling parametrize with indirect, ids or scope as positional arguments (similarly to what we did with fixtures)? I think almost nobody is using them this way, and making those keyword-only would certainly help a lot for situations like this.
I started giving more and more pytest trainings recently, and noticed a confusion almost everyone stumbles over when using parametrize the first time. Many people accidentally write:
i.e. they use
"arg1", "arg2"
instead of"arg1, arg2"
or("arg1", "arg2")
for parametrize. This results in:which is an error message which will confuse newcomers even more (they probably have no idea what an indirect fixture is supposed to be at this point).
We should really try to somehow improve that message, maybe be suggesting the right usage?
The text was updated successfully, but these errors were encountered: