From b21a7c3021eee7aed64114f11e4f8d17d805a25f Mon Sep 17 00:00:00 2001 From: joddeepesh-cloud Date: Mon, 29 Dec 2025 00:22:29 +0530 Subject: [PATCH] docs : clarify fixture scope behaviour for parametrized fixtures --- doc/en/how-to/fixtures.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 5c5a239e8d4..42b235621b1 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -505,6 +505,13 @@ Fixtures are created when first requested by a test, and are destroyed based on means that when using a parametrized fixture, pytest may invoke a fixture more than once in the given scope. + .. note:: + + When using parametrized fixtures, pytest determines the effective scope based on + how the fixture is defined. If parameters are provided in a way that limits reuse, + pytest will automatically use the narrowest applicable scope to ensure correct + isolation between tests. + .. _dynamic scope: Dynamic scope