-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide dependency-tested autouse fixtures #1050
Comments
Could you clarify a bit @RonnyPfannschmidt? Perhaps with an example. |
i have a vague idea what you mean but would like to see a clearer problem statement and an example as well. |
should allow |
is From a usability side it might be better to explicitly list "triggering" fixtures like in the above case Implementation wise i guess it's not easy to implement but not sure. |
Correc, just a initial example |
I'd like to share a use case for this functionality. The pytest-asyncio plugin allows users to use coroutines and async generators for tests and fixtures as illustrated in the following example:
Pytest-asyncio also exposes the current asyncio event loop via an What I'd like to do is something like:
Pytest-asyncio currently tries to emulate this behaviour by tapping into FixtureManager. It uses Do you think this a valid use case for this feature? |
It's not a direct match, however we currently also have no sane way to attach a fixture only to specific tests For event loop control it may be a good idea to make a hook wrapper for the test protocol hooks |
autouse fixures should have a mode of operation that triggers them only if the fixtures they need are used by the current test to begin with
The text was updated successfully, but these errors were encountered: