From 50eb08f211d8d94ba385f1ff84d35fc3e9cd151b Mon Sep 17 00:00:00 2001 From: morning-verlu <258725120+morning-verlu@users.noreply.github.com> Date: Sun, 31 May 2026 22:53:11 +0800 Subject: [PATCH 1/2] Clarify request fixture in indirect parametrization docs --- changelog/13155.doc.rst | 1 + doc/en/example/parametrize.rst | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 changelog/13155.doc.rst diff --git a/changelog/13155.doc.rst b/changelog/13155.doc.rst new file mode 100644 index 00000000000..a4faf22fa4a --- /dev/null +++ b/changelog/13155.doc.rst @@ -0,0 +1 @@ +Clarified how the ``request`` fixture provides indirect parametrization values via ``request.param``. diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index ae64a7c62d5..8b68662950f 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -370,6 +370,11 @@ test: def test_indirect(fixt): assert len(fixt) == 3 +The ``request`` argument used by the fixture is pytest's built-in +:py:class:`FixtureRequest ` fixture. For indirect +parametrization, the value supplied to the test parameter is passed to the +fixture and made available as ``request.param``. + This can be used, for example, to do more expensive setup at test run time in the fixture, rather than having to run those setup steps at collection time. From fb35b4066d40307fc7c58ad83058097c354e074f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 4 Jun 2026 09:45:10 -0300 Subject: [PATCH 2/2] Add as note' --- doc/en/example/parametrize.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 8b68662950f..de668def863 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -370,14 +370,19 @@ test: def test_indirect(fixt): assert len(fixt) == 3 -The ``request`` argument used by the fixture is pytest's built-in -:py:class:`FixtureRequest ` fixture. For indirect -parametrization, the value supplied to the test parameter is passed to the -fixture and made available as ``request.param``. This can be used, for example, to do more expensive setup at test run time in the fixture, rather than having to run those setup steps at collection time. +.. note:: + + The ``request`` argument used by the fixture is pytest's built-in + :py:class:`FixtureRequest ` fixture. For indirect + parametrization, the value supplied to the test parameter is passed to the + fixture and made available as ``request.param``. + + For more information, see :ref:`fixture-parametrize`. + .. regendoc:wipe Apply indirect on particular arguments