conftest fixtures dependent on partially configured plugin #12758
-
This issue may be too specific to be considered a bug and may not warrant a feature request, so I'm posting here first to see if anyone has a good solution. I use In my particular circumstance, this creates a problem, because the fixtures I am creating in my I understand that the I am currently working around the problem by putting the shared fixtures in a separate fixtures.py file instead of in conftest.py, and then importing it in each test module that needs to use those fixtures (which is most of them). This is less than ideal for a number of reasons. One possible enhancement to address this situation would be that, where shared figures need to be created by other plugin features are not required, instead of putting them in conftest.py, they could be placed in a different file (say 'features.py') that is loaded later in the test setup process, after all the plugins have been loaded and all plugin hooks executed. Does this seem like an enhancement that would be considered and that would have application outside of my narrow circumstance? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
At first glance it sounds like there's a lot of stuff broken You can self implement your proposed solution by implementing a try last marked pytest- configure hook that registers the new plugin after import If that's not feasible it can also be done in the session start Hook It would be better if you could get by in a different way, it's fragile |
Beta Was this translation helpful? Give feedback.
-
Thanks! Using a |
Beta Was this translation helpful? Give feedback.
At first glance it sounds like there's a lot of stuff broken
You can self implement your proposed solution by implementing a try last marked pytest- configure hook that registers the new plugin after import
If that's not feasible it can also be done in the session start Hook
It would be better if you could get by in a different way, it's fragile