diff --git a/changelog/13503.bugfix.rst b/changelog/13503.bugfix.rst new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 7374fa3cee0..a43443c2077 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1526,9 +1526,9 @@ def _find_parametrized_scope( if all_arguments_are_fixtures: fixturedefs = arg2fixturedefs or {} used_scopes = [ - fixturedef[-1]._scope - for name, fixturedef in fixturedefs.items() - if name in argnames + fixturedefs[name][-1]._scope # correction part + for name in argnames + if name in fixturedefs ] # Takes the most narrow scope from used fixtures. return min(used_scopes, default=Scope.Function)