-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Support @pytest.mark.usefixture in fixtures #5783
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
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 |
master
branch for bug fixes, documentation updates and trivial changes.features
branch for new features, improvements, and removals/deprecations.changelog
folder, with a name like<ISSUE NUMBER>.<TYPE>.rst
. See changelog/README.rst for details.AUTHORS
in alphabetical order;Followup from #3664 (comment).
I am trying to get the @pytest.mark.usefixture marker to work with fixtures as well.