When do module scoped fixtures run? #9998
Unanswered
jasonhoppessf
asked this question in
General
Replies: 1 comment
-
Hi @jasonhoppessf, They execute as soon as the first test in a module requests it, and are deleted later when the last test of the module finishes (regardless if it requested the module-scoped fixture or not) 1. Footnotes
|
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
-
I am new to pytest and I have seen two contradictory examples online. Do module scoped fixtures run as soon as the module is loaded or when passed to a method? If as soon as the module is loaded how do I determine the order? One example is here with grpc_add_to_server https://pypi.org/project/pytest-grpc/. The other example is from the documentation https://docs.pytest.org/en/6.2.x/fixture.html#higher-scoped-fixtures-are-executed-first.
Beta Was this translation helpful? Give feedback.
All reactions