Fix a bug

This commit is contained in:
Sadra Barikbin 2023-07-21 04:46:37 +03:30
parent 768f47f376
commit 01b5db543a
1 changed files with 2 additions and 2 deletions

View File

@ -259,11 +259,11 @@ def get_fixture_keys(item: nodes.Item, scope: Scope) -> Iterator[_Key]:
# a scope, it overrides that of the fixture. # a scope, it overrides that of the fixture.
if ( if (
is_parametrized 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): ) or (not is_parametrized and fixturedef._scope == scope):
param_index = None param_index = None
if is_parametrized: if is_parametrized:
param_index = cast(Function, item).callspec.indices[argname] param_index = cast("Function", item).callspec.indices[argname]
if scope is Scope.Session: if scope is Scope.Session:
key: _Key = (argname, param_index) key: _Key = (argname, param_index)