diff options
| author | robot-piglet <[email protected]> | 2026-02-05 00:01:34 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2026-02-05 00:26:14 +0300 |
| commit | 00b2bc2db9a43c4cb6bf6c3eb714323b8a56ab92 (patch) | |
| tree | a9ee6f91978e6a6c6486478a4c5c7fa6250baeca /contrib/python/pytest/py3 | |
| parent | 02db44946aa3b53b1251803679f98b383a5c9a32 (diff) | |
Intermediate changes
commit_hash:1498685c4de200e86921a4b861dbe2a98b31b9ab
Diffstat (limited to 'contrib/python/pytest/py3')
| -rw-r--r-- | contrib/python/pytest/py3/_pytest/fixtures.py | 8 | ||||
| -rw-r--r-- | contrib/python/pytest/py3/patches/09-backport-8.4-parametrized-fixtures.patch | 16 |
2 files changed, 22 insertions, 2 deletions
diff --git a/contrib/python/pytest/py3/_pytest/fixtures.py b/contrib/python/pytest/py3/_pytest/fixtures.py index 206fd084ae4..f96b081545b 100644 --- a/contrib/python/pytest/py3/_pytest/fixtures.py +++ b/contrib/python/pytest/py3/_pytest/fixtures.py @@ -641,8 +641,12 @@ class FixtureRequest(abc.ABC): self, scope, param, param_index, fixturedef, _ispytest=True ) - # Check if a higher-level scoped fixture accesses a lower level one. - subrequest._check_scope(argname, self._scope, scope) + # The parametrize invocation scope only controls caching behavior while + # allowing wider-scoped fixtures to keep depending on the parametrized + # fixture. Scope control is enforced for parametrized fixtures + # by recreating the whole fixture tree on parameter change. + # Hence `fixturedef._scope`, not `scope`. + subrequest._check_scope(argname, self._scope, fixturedef._scope) try: # Call the fixture function. fixturedef.execute(request=subrequest) diff --git a/contrib/python/pytest/py3/patches/09-backport-8.4-parametrized-fixtures.patch b/contrib/python/pytest/py3/patches/09-backport-8.4-parametrized-fixtures.patch new file mode 100644 index 00000000000..0bd5156a2a3 --- /dev/null +++ b/contrib/python/pytest/py3/patches/09-backport-8.4-parametrized-fixtures.patch @@ -0,0 +1,16 @@ +--- contrib/python/pytest/py3/_pytest/fixtures.py (index) ++++ contrib/python/pytest/py3/_pytest/fixtures.py (working tree) +@@ -641,8 +641,12 @@ class FixtureRequest(abc.ABC): + self, scope, param, param_index, fixturedef, _ispytest=True + ) + +- # Check if a higher-level scoped fixture accesses a lower level one. +- subrequest._check_scope(argname, self._scope, scope) ++ # The parametrize invocation scope only controls caching behavior while ++ # allowing wider-scoped fixtures to keep depending on the parametrized ++ # fixture. Scope control is enforced for parametrized fixtures ++ # by recreating the whole fixture tree on parameter change. ++ # Hence `fixturedef._scope`, not `scope`. ++ subrequest._check_scope(argname, self._scope, fixturedef._scope) + try: + # Call the fixture function. |
