Fix parameter mark precedence#14778
Closed
ace2016 wants to merge 1 commit into
Closed
Conversation
Co-authored-by: Codex <codex@openai.com>
Member
|
already working on it in #14630 |
Author
I didn't know thank you for the notice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10406.
Summary
Parameter-set marks should be more specific than marks applied to the test function, class, or module.
This change:
iter_markers()yield callspec/parameter-set marks before function-level marks;own_markersstorage order for compatibility;filterwarningsmarks from farthest to closest so the most specific filter wins;Root cause
Function.own_markersstores function marks before callspec marks, causingiter_markers()to report the function mark as more specific.Additionally,
warnings.filterwarnings()inserts filters at the front. Processing closest marks first therefore allowed farther class or module filters to override them. In some function-level cases, these two ordering errors accidentally cancelled each other.Testing
testing/test_mark.pyandtesting/test_warnings.py: 164 passed, 4 skipped, 1 xfailedtesting/test_nodes.pyandtesting/python: 660 passed, 6 skipped, 3 xfailedgit diff --checkpassedChecklist
Closes #10406.Co-authored-bycommit trailer.