From 2c0d0e12027d26e49d212f26441a1567d2490049 Mon Sep 17 00:00:00 2001 From: Dr Alex Mitre Date: Thu, 5 Mar 2026 14:02:26 -0600 Subject: [PATCH 1/2] docs: clarify request fixture in indirect parametrization Explain that `request` is the built-in fixture object and that `request.param` carries each indirect parameter value. --- doc/en/example/parametrize.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index b25b822618a..251bd13fe46 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -356,6 +356,11 @@ Using the ``indirect=True`` parameter when parametrizing a test allows one to parametrize a test with a fixture receiving the values before passing them to a test: +The fixture receives the built-in ``request`` fixture object as its first +argument. For indirect parametrization, each value from +``@pytest.mark.parametrize`` is available as ``request.param`` inside that +fixture. + .. code-block:: python import pytest From d6c4e107d1d1f018859b1da7a42a6f5cee885943 Mon Sep 17 00:00:00 2001 From: Dr Alex Mitre Date: Thu, 5 Mar 2026 14:04:22 -0600 Subject: [PATCH 2/2] changelog: add fragment for request fixture docs clarification Add changelog/13155.doc.rst to satisfy changelog checks for PR #14260. --- changelog/13155.doc.rst | 1 + 1 file changed, 1 insertion(+) 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..8b1fa911b26 --- /dev/null +++ b/changelog/13155.doc.rst @@ -0,0 +1 @@ +Clarified in the parametrization examples that the built-in ``request`` fixture is used for indirect parametrization and that values are available through ``request.param``.