Skip to content

Fix marker precedence for parametrized tests#14782

Open
deepakganesh78 wants to merge 2 commits into
pytest-dev:mainfrom
deepakganesh78:fix-10406-marker-precedence
Open

Fix marker precedence for parametrized tests#14782
deepakganesh78 wants to merge 2 commits into
pytest-dev:mainfrom
deepakganesh78:fix-10406-marker-precedence

Conversation

@deepakganesh78

Copy link
Copy Markdown

Summary

  • make callspec markers override function, class, and module markers
  • apply warning filters from farthest to closest while preserving same-node decorator order
  • add regression tests for parametrized marker and warning-filter precedence

Validation

  • testing/test_mark.py testing/test_warnings.py (168 passed, 4 skipped, 1 xfailed)
  • testing/test_recwarn.py (67 passed)
  • pre-commit on all touched files, including mypy
  • full suite: 4207 passed; one unrelated Windows pydoc encoding failure

Closes #10406

Apply closest markers last across callspec and warning-filter paths while preserving same-node decorator ordering.

Closes pytest-dev#10406

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jul 25, 2026
Run warning precedence cases in-process and keep generated source compact so patch coverage observes the exercised branches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@medecau

medecau commented Jul 25, 2026

Copy link
Copy Markdown

duplicate of #14630?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@pytest.mark.* priority seems wrong

2 participants