Skip to content

Resolve relative labels independently of parameter ID syntax - #273

Merged
mrbean-bremen merged 3 commits into
pytest-dev:mainfrom
jihtsan:codex/272-parameter-id-labels
Oct 29, 2026
Merged

mrbean-bremen merged 3 commits into
pytest-dev:mainfrom
jihtsan:codex/272-parameter-id-labels

Conversation

@jihtsan

@jihtsan jihtsan commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #272.

Relative references such as order(after="test_source") currently fail when the referenced test has parameter IDs containing nested brackets or ::. The marker is ignored and dependent tests execute too early. Use pytest's original function name to identify the unparameterized node, retaining the actual full node ID for item identity. Class-label matching also ignores parameter contents.

Add regressions for module and class methods, before/after relationships, class labels, nested brackets, IPv6-like IDs, ::() and slash-containing IDs. This preserves the documented whole-test reference behavior; it does not add support for referencing individual parameter cases.

Validation on macOS, Python 3.12.14 / pytest 9.2.0:

  • Real pytest reproduction changes from 1 failure + 1 pass to 2 passes.
  • Full suite: 166 passed on both Python 3.12.14 / pytest 9.2.0 and Python 3.10.21 / minimum pytest 6.2.4.
  • Branch-inclusive coverage: 98.7435% on unchanged main, 98.7487% after; the same 3 missing statements and 9 partial branches, with no new gaps.
  • Pinned Ruff 0.17.1 checks/format and mypy 2.4.0 pass; git diff --check passes.

Linux/Windows and the full supported Python/pytest matrix were not run locally. Hosted CI remains pending.

AI-assisted implementation, testing and review.

Changelog reference validation: the release note now links Issue #272. Applicable configured pre-commit checks for CHANGELOG.md and git diff --check pass. Runtime code, configuration and tests are unchanged from 86ce35847ef4caaede4228ba16fae1d94a680d39; the previously reported 166-test runs in both environments remain bound to that SHA and were reused, not rerun for this documentation-only commit.

@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.22%. Comparing base (8604650) to head (3e70018).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #273      +/-   ##
==========================================
+ Coverage   98.21%   98.22%   +0.01%     
==========================================
  Files           5        5              
  Lines         671      675       +4     
  Branches      142      142              
==========================================
+ Hits          659      663       +4     
  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.

Comment thread CHANGELOG.md Outdated
## Unreleased

### Fixes
* Relative ordering resolves whole-test labels when parameter IDs contain brackets or node separators.

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.

Please also add a reference to the issue.

@mrbean-bremen
mrbean-bremen force-pushed the codex/272-parameter-id-labels branch from 473e3f5 to 3e70018 Compare October 29, 2026 17:31

@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 7420d46 into pytest-dev:main Oct 29, 2026
18 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.

Relative ordering loses parameterized tests whose IDs contain brackets or node separators

3 participants