-
-
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 for including fixtures from common location [improvement] #3625
Comments
GitMate.io thinks possibly related issues are #1050 (provide dependency-tested autouse fixtures), #3351 (Is there a way to provide mark with fixture params), #1376 (allow fixtures to provide extra info when a test fails), #2502 (How to provide fixture parameters at test level?), and #1216 (Provide a way to nicely control fixture execution order ). |
Thanks @astraw38,
Here's a solution to this problem: #3582 (comment) IMHO this is enough to which I think fits your requirements 1 and 2. What do you think? |
Importing isn't ideal, because you get unused imports warnings from most code analysis tools, and invariably you'll have to deal with someone 'optimizing' those imports later, and breaking your conftest. |
I see. Usually putting a few Btw, you don't want to use I ask because pytest_plugin = ['myapp.some_fixtures', 'myapp.other_fixtures'] |
Exactly. It's rather unintuitive that it would affect global scope. For most fixtures, not that big of a deal, but could be a problem with autouse fixtures (and would pollute the output of pytest --fixtures). |
OK, thanks for the clarification. |
@astraw38 see the approach I've eventually adopted: |
It'd be very convenient to have a method similar to
pytest_plugins = ['path.to.plugin']
, but purely for fixture inclusion.Reasoning:
The text was updated successfully, but these errors were encountered: