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
Please refer to the discussion in #1595, but the gist is this:
... we have to obtain all items during the collection phase, and fixtures parametrized that way won't be executed until the first test that uses it executes, long past the collection phase.
I'm closing this for now, but feel free to ask for clarification!
I need to parametrize a test which requires
tmpdir
fixture to setup different testcases.Suppose initial test looks like this:
I can't use
tmpdir
in parametrize, so either I would preferindirect
parametrization, or parametrization through a fixture.Alternative 1: Indirect Parametrization
Alternative 2: Parametrizing through fixture
Alternative two is a little less entangled but one can easily miss a bug if he adds testcases in function body but forgets to update
range(3)
.Currently fixtures yield only once but it will be really great if multiple yields results in parametrization.
Example code would simply reduce to:
The text was updated successfully, but these errors were encountered: