Skip to content

Handle node separators in parameter IDs during class-scoped ordering - #270

Merged
mrbean-bremen merged 1 commit into
pytest-dev:mainfrom
ShahadatTest:fix/class-scope-parameter-separators
Oct 26, 2026
Merged

mrbean-bremen merged 1 commit into
pytest-dev:mainfrom
ShahadatTest:fix/class-scope-parameter-separators

Conversation

@ShahadatTest

Copy link
Copy Markdown
Contributor

With --order-scope=class, module-level parametrized tests whose IDs contain :: (for example IPv6 addresses) are treated as separate classes. Their order markers then have no effect: test_last[::1] runs before test_first[::1].

Use pytest's class collector to identify class membership, with the existing module fallback for functions outside classes. This avoids parsing a parameter ID as a node separator. Add a failing class-scope integration case and two passing group-scope controls, plus release notes.

Validation on Windows:

  • New class-scope case fails on unchanged main; all three new cases pass after.
  • Full suite: 163 passed on Python 3.12 / pytest 9.1.1 and Python 3.10 / minimum pytest 6.2.4.
  • All configured pre-commit hooks pass, including mypy.
  • Coverage started before plugin import: the same 3 uncovered statements and 9 partial branches as a clean upstream worktree. Total branch-inclusive coverage is 98.74% versus baseline 98.75%; the denominator shrank by 2 statements and 2 branches. There are no new coverage gaps.
  • git diff --check passes.

Prepared and tested with OpenAI Codex.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.21%. Comparing base (a68a7b3) to head (776abbe).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #270      +/-   ##
==========================================
- Coverage   98.21%   98.21%   -0.01%     
==========================================
  Files           5        5              
  Lines         673      671       -2     
  Branches      143      142       -1     
==========================================
- Hits          661      659       -2     
  Misses          3        3              
  Partials        9        9              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mrbean-bremen mrbean-bremen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mrbean-bremen
mrbean-bremen merged commit 4dcf4d4 into pytest-dev:main Oct 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants