Support @pytest.mark.usefixture in fixtures#5783
Support @pytest.mark.usefixture in fixtures#5783youtux wants to merge 2 commits intopytest-dev:masterfrom youtux:usefixtures-in-fixtures
Conversation
This comment has been minimized.
This comment has been minimized.
|
(Revisiting this) The PR looks well written for a first draft, thanks! (Sorry for not commenting on it previously, missed the notification most likely). I think once people notice that they can use Is it a good idea to eventually support @RonnyPfannschmidt what do you think? Btw this discussion is out of scope for this PR, just me thinking aloud to get feedback. |
|
Hmmm just realized that this technically might be a challenge, because marks usually are applied during collection, and fixtures are lazily evaluated during test call... |
|
its technically incredibly hard to correctly transfer markers from fixtures to nodes, until we have a sound solution for markers on fixtures, its not acceptable to have some of them a little bit magically a sound solution is hard to impossible right now as the fixture system has various features that make this more tricky (like replacing vs enhancing fixtures, dynamic fixture requests and a few more details) as well as the fact that the current internals of fixtures are rather frickly and fragile as the result of their development history revisiting the original issue i have to note that while we improved some parts of marks, the parts that make it fundamentally a bad choice to support them on fixtures is still the same |
(I've changed the base on my own now). |
Agree completely. 👍 |
|
I soon realized after digging a little bit into pytest internals that indeed this would require a major architectural change, not just a small patch. |
|
Thanks @youtux for trying! We appreciate it. |
Does the mechanism to use fixtures need to be a mark? How about defining |
masterbranch for bug fixes, documentation updates and trivial changes.featuresbranch for new features, improvements, and removals/deprecations.changelogfolder, with a name like<ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.AUTHORSin alphabetical order;Followup from #3664 (comment).
I am trying to get the @pytest.mark.usefixture marker to work with fixtures as well.