From 01b5db543a74d5de6636cc8357f919e3cb45aa9b Mon Sep 17 00:00:00 2001 From: Sadra Barikbin Date: Fri, 21 Jul 2023 04:46:37 +0330 Subject: [PATCH] Fix a bug --- src/_pytest/fixtures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 09196cfa9..5cfc6dc75 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -259,11 +259,11 @@ def get_fixture_keys(item: nodes.Item, scope: Scope) -> Iterator[_Key]: # a scope, it overrides that of the fixture. if ( is_parametrized - and cast(Function, item).callspec._arg2scope[argname] == scope + and cast("Function", item).callspec._arg2scope[argname] == scope ) or (not is_parametrized and fixturedef._scope == scope): param_index = None if is_parametrized: - param_index = cast(Function, item).callspec.indices[argname] + param_index = cast("Function", item).callspec.indices[argname] if scope is Scope.Session: key: _Key = (argname, param_index)