-
-
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
Can't override an autouse fixture ordering #3404
Comments
GitMate.io thinks possibly related issues are #3225 (A fixture with autouse set to False will always be used if it overrides a fixture with autouse set to True), #1601 (Overriding autouse fixture with a parametrized fixture does not work), #1216 (Provide a way to nicely control fixture execution order ), #668 (autouse fixtures break scope rules), and #336 (pytest-2.4.0.dev7 crashes with some autouse fixtures). |
autouse fixture are always considered before fixtures that are named, so it doesn't matter in which way you order them on a function, the autouse flag takes precedence over the order in the function call |
@wimglenn can we close this or do we still need address something? |
we should review if the docs on this are clear enough, but otherwise i believe there is nothing we can do |
A case with a fixture use both as an autouse and explititly was raised. This case sounds too narrow to add to documentation (and could be misleading for people learning pytest with explicitely using an autouse fixture). At the same time there was no documentation on the autouse vs regular fixture order, therefore this commit adds such an information. Code sample grew and it was extracted to the file.
Add autouse fixture order information (#3404).
@wojtekerbetowski, @The-Compiler do you plan on fixing that last commit or should I try to change the docs myself? |
@nnrepos @The-Compiler - I'm not sure whether I understand the prolem. Is this the coverage on an added test example? What is the rule here? Should examples be excluded from codecov, or executed during that part of the build? |
@nnrepos I don't follow - what's there to fix? |
@bluetech ok to close this ? My PR was deemed unnecessary so I think we have no doc or code changes to do here 👍 |
pytest 3.5.0 on Python 3.6.5 (macOS). This result surprised me:
To be clear, first 3 tests are passing OK but the
test_fix_fixauto
fails. I would have expected that explicitly injecting an autouse fixture could be used to override the usual order. Feature or bug?The text was updated successfully, but these errors were encountered: