-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Exposed autoused fixture names as global variable for tests (#1…
…3171) Signed-off-by: Élie Goudout <[email protected]>
- Loading branch information
1 parent
2f36984
commit 698f8ea
Showing
3 changed files
with
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Exposed autoused fixture names as global variables for tests. | ||
|
||
Two caveats: | ||
- It is still not possible to directly use, for example, `autoused_int_fixture += 1` without a prior `global autosed_int_fixture` statement in test definition. | ||
- This feature makes the test work on a copy of its `.__globals__` dict. So if the test actually modifies `globals()` (which looks like a terrible idea and is probably discouraged somewhere in pytest docs), it may cause issues. |
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