Repository navigation
[PR #15374/fc9a7ef6 backport][9.2.x] Store raw parametrize ids on a shared mark, not resolved ones - #15375
Merged
RonnyPfannschmidt merged 1 commit intoNov 11, 2026
Conversation
Store raw parametrize ids on a shared mark, not resolved ones (cherry picked from commit fc9a7ef)
5 tasks done
RonnyPfannschmidt
approved these changes
Nov 11, 2026
RonnyPfannschmidt
enabled auto-merge
November 11, 2026 12:01
RonnyPfannschmidt
deleted the
patchback/backports/9.2.x/fc9a7ef678f64d17f1c03b619f3842ea1d127e74/pr-15374
branch
November 11, 2026 12:20
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.
This is a backport of PR #15374 as merged into main (fc9a7ef).
Requested by Ronny · project thread
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.
Closes #15370.
The ids cache on the source parametrize mark (
Mark._param_ids_generated) exists so an ids iterator (#759) is consumed only once by all tests sharing the mark. It stored the output of_resolve_parameter_set_ids(escaped, made unique) and fed it back as inputids=, so every further test sharing the mark escaped the ids again. The mark lives on the imported module, so this also carried over betweenpytest.main()calls in one process.The fix stores the validated raw ids instead and resolves them on every call. Unlike skipping the second resolution, this also stops later sessions from reusing ids resolved under another session's config (for example the id-escaping ini option, or a different
pytest_make_parametrize_id).Test: one unit test that runs a shared mark with an iterator id needing escaping through two
Metafuncs. It fails onmainand passes with the fix.testing/python,testing/test_mark.py,testing/test_collection.py,testing/test_nodes.pyshow no new failures.closes #XYZWto the PR description and/or commits.Co-authored-bycommit trailers.changelogdirectory.Generated by Claude Code