Make Metafunc.parametrize keyword-only from indirect onwards#14753
Conversation
Passing indirect/ids/scope positionally was a common source of
confusing errors -- most notably parametrize("arg1", "arg2", [(1, 2)])
sending the argvalues into indirect and failing with "indirect fixture
'(1, 2)' doesn't exist" (pytest-dev#8593). The type annotations for the
pytest.mark.parametrize stub have declared these arguments keyword-only
all along; this aligns the runtime signature.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RzGTXa8VxHtYauuhN51Mv
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RzGTXa8VxHtYauuhN51Mv
…ntion Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RzGTXa8VxHtYauuhN51Mv
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
might want to do a grep.app search as community service - there mgiht be missed breaks for downstreams
|
I had Claude run some scans of the ecosystem: 1. PyPI top-5000 AST scan. Downloaded the sdist of each of the top 5000 packages by downloads. 4,905 packages scanned successfully (564,808 Python files), containing 135,419 2. GitHub-wide AST sample. Via Sourcegraph's search API, fetched 467 complete files across 140 repos matching 3. GitHub-wide regex counts. Against a baseline of ~1.57M Given the benefits to new users, I'm comfortable merging. |
Passing indirect/ids/scope positionally was a common source of confusing errors -- most notably
parametrize("arg1", "arg2", [(1, 2)])sending the argvalues into indirect and failing with "indirect fixture '(1, 2)' doesn't exist" (closes #8593).The type annotations for the
pytest.mark.parametrizestub have declared these arguments keyword-only all along; this aligns the runtime signature.Technically a breaking change, but I think the overwhelmingly common case is that it was a confusing error, not a deliberate positional use.