Repository navigation
Resolve relative class markers for nested classes - #281
Merged
mrbean-bremen merged 1 commit intoNov 30, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #281 +/- ##
==========================================
+ Coverage 97.94% 98.09% +0.14%
==========================================
Files 5 5
Lines 682 681 -1
Branches 144 144
==========================================
Hits 668 668
Misses 4 4
+ Partials 10 9 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Class-level relative markers are ignored when the referenced class is nested. For example,
after="TestAnchor"works for top-level sibling classes but warns that the label cannot be found after placing those classes insideTestOuter.Resolve class labels through pytest's collection hierarchy, including tests in descendant classes. Also use actual class membership when distinguishing bare method names from class labels, so the existing class-marker restriction is consistent at every nesting level. Qualified method references continue to work for nested siblings.
Reproducer, using only the public pytest interface:
Run
python -m pytest -v test_example.pywith pytest-order installed. Before the fix, the marker is ignored and the dependent test fails; afterward, both tests pass in the requested order.Validation:
item_names_forfixture: eight fail against the original implementation and one is an unchanged control. All pass with the fix.git diff --checkpass.This does not add directory/file ordering targets or support references to individual parameter cases.