-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
MarkGenerator: Report unknown mark warning at caller level #5929
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
MarkGenerator: Report unknown mark warning at caller level #5929
Conversation
Should I add a test for this? |
Hi @allanlewis, thanks a lot for this! Yes, a test would be appreciated, thanks. |
Test might be nice, but for this kind of things it is often not tested already (and not trivial). |
Indeed, but we should have tests for warning locations because those things can regress (a refactoring might change the call stack depth). But @allanlewis let us know if you have trouble coming up with a test, we would be glad to help! |
Related: #4445 |
Currently, `PytestUnknownMarkWarning` is reported at the level of `MarkGenerator`, which is unhelpful to callers as the warning is shown as being "caused" by pytest. This commit therefore increases the stack level passed to the warning call to 2, which will make the warning log as being "caused" by the caller, which is much more helpful. Resolves #5928.
Rebased on master. |
@allanlewis |
I don't think I have permissions to do that - @nicoddemus ? |
@xibalba01 could do it. |
Just for the record, hypothesis failed the build here again (osx):
|
Sure i can try! I would have to add @allanlewis's fork as remote, right?! Never did this kind of "merging" of pull requests :) |
Yes. with https://github.com/github/hub you can do |
Ok just did it manually. Will have a look at |
Closing in favor of #5984. |
Currently,
PytestUnknownMarkWarning
is reported at the level ofMarkGenerator
, which is unhelpful to callers as the warning is shown as being "caused" by pytest. This commit therefore increases the stack level passed to the warning call to 2, which will make the warning log as being "caused" by the caller, which is much more helpful.master
branch for bug fixes, documentation updates and trivial changes.features
branch for new features, improvements, and removals/deprecations.Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
changelog
folder, with a name like<ISSUE NUMBER>.<TYPE>.rst
. See changelog/README.rst for details.AUTHORS
in alphabetical order;Closes #5928.