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``. 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