Skip to content

Extract the parametrization core into _pytest.parametrize - #14856

Draft
RonnyPfannschmidt wants to merge 2 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/extract-parametrize
Draft

RonnyPfannschmidt wants to merge 2 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/extract-parametrize

Conversation

@RonnyPfannschmidt

@RonnyPfannschmidt RonnyPfannschmidt commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Note

Stack: #14855 -> #14856 -> #14769 -> #14857 -> #14858. Review only the last commit.

Pure move, no behaviour change.

IdMaker, CallSpec and _ascii_escaped_by_config move out of python.py
into a new _pytest.parametrize, together with the long-str id strategy
literals they own. python.py imports them back, so _pytest.python.CallSpec
and the CallSpec2 alias keep resolving as before.

The two CollectError call sites go through a small _collect_error() helper
which imports nodes lazily, so nodes stays free to import this module later.

Groundwork for #3926: the parametrization core has to be reachable from
non-Python collectors.

@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch from ceb60f3 to 7588088 Compare August 11, 2026 10:45
@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Aug 11, 2026
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch from 7588088 to a114fc8 Compare August 11, 2026 18:34
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch from a114fc8 to d0aabf4 Compare August 11, 2026 18:39
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch 2 times, most recently from 73227f0 to 8bc239b Compare August 11, 2026 19:25
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch from 8bc239b to 70a056e Compare September 15, 2026 11:51
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch from 70a056e to b78d468 Compare September 23, 2026 07:00
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch 2 times, most recently from 236e0ce to 1981cd8 Compare October 11, 2026 07:26
TestReport.from_item_and_call asserted reportinfo() yields a line
number. Items which cannot point at a line -- non-Python items
legitimately report None -- crashed with an INTERNALERROR when skipped
via a marker. Report the location without a line instead.
Move IdMaker, CallSpec and _ascii_escaped_by_config out of python.py
into a new module, together with the long-str id strategy literals they
own. python.py imports them back, so _pytest.python.CallSpec and the
CallSpec2 alias keep resolving as before.

Pure move, no behaviour change. The two CollectError call sites go
through a small _collect_error() helper which imports nodes lazily, so
nodes stays free to import this module later.
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/extract-parametrize branch from 1981cd8 to f1865ac Compare October 14, 2026 20:28

This branch has not been deployed

No deployments
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.

1 participant