forked from pytest-dev/pytest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First approach to enforcing setting 'indirect' on dependent fixtures
This is a try to solve pytest-dev#5712 using following logic: (1) If there exists a fixture F which uses say parameter A (2) And there exist a test T in which parameter named A is present in pytest.mark.parametrize() arglist (3) Then A should be marked explicitly as indirect (via indirect=True or indirect=['A',...]) And if it isn't, we raise ValueError TODO: as of now, ValueError occurs during collection phase. Maybe we want it to appear during test phase?
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Actually I believe the problem is simpler: the argnames in
parametrize
either must be declared explicitly on the function or explicitly in theindirect
list.So the original example:
Would fail with an error, and should be updated to: