-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Add support for pytest fixtures from local pytest plugins. #1907
Add support for pytest fixtures from local pytest plugins. #1907
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1907 +/- ##
=======================================
Coverage 94.45% 94.46%
=======================================
Files 80 80
Lines 11917 11932 +15
=======================================
+ Hits 11256 11271 +15
Misses 661 661 ☔ View full report in Codecov by Sentry. |
Hmm good point. I feel like generally you could just infer instead of goto and if a list is inferred infer the inner list elements. That's probably a bit more "solid". So the order is |
@davidhalter |
e1ed8b2
to
9b8cece
Compare
@moser Thanks! This looks generally good. It's still marked as a draft. So you might want to finish whatever you want to do and then I'll merge. |
@davidhalter Ready from my side :-) |
Thanks a lot Martin, good stuff! |
I like to structure my pytest fixtures in files separate from
conftest.py
. The pytest docs advise to include those modules containing fixtures as plugin modules, by giving the fully qualified names as strings in an array assinged topytest_plugins
in theconftest.py
.In this PR, I propose adding the modules from the above-mentioned list to the fixture source modules for better completion and type inference.
I guess that my approach in
_load_pytest_plugins
is a bit crude and could use some feedback and error handling. Can you give me feedback on this?