File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 9595# The parameters that a fixture function receives.
9696FixtureParams = ParamSpec ("FixtureParams" )
9797
98+ # A dict of fixture name -> its FixtureDef.
99+ FixtureDefDict : TypeAlias = dict [str , "FixtureDef[Any]" ]
100+
98101# The type of fixture function (type alias generic in fixture params and value).
99102_FixtureFunc : TypeAlias = Union [
100103 Callable [FixtureParams , FixtureValue ],
@@ -370,7 +373,7 @@ def __init__(
370373 pyfuncitem : Function ,
371374 fixturename : str | None ,
372375 arg2fixturedefs : dict [str , Sequence [FixtureDef [Any ]]],
373- fixture_defs : dict [ str , FixtureDef [ Any ]] ,
376+ fixture_defs : FixtureDefDict ,
374377 * ,
375378 _ispytest : bool = False ,
376379 ) -> None :
Original file line number Diff line number Diff line change 5151from _pytest .config .argparsing import Parser
5252from _pytest .deprecated import check_ispytest
5353from _pytest .fixtures import FixtureDef
54+ from _pytest .fixtures import FixtureDefDict
5455from _pytest .fixtures import FixtureRequest
5556from _pytest .fixtures import FuncFixtureInfo
5657from _pytest .fixtures import get_scope_node
@@ -1085,7 +1086,7 @@ def get_direct_param_fixture_func(request: FixtureRequest) -> Any:
10851086
10861087
10871088# Used for storing pseudo fixturedefs for direct parametrization.
1088- name2pseudofixturedef_key = StashKey [dict [ str , FixtureDef [ Any ]] ]()
1089+ name2pseudofixturedef_key = StashKey [FixtureDefDict ]()
10891090
10901091
10911092@final
@@ -1271,7 +1272,7 @@ def parametrize(
12711272 if node is None :
12721273 name2pseudofixturedef = None
12731274 else :
1274- default : dict [ str , FixtureDef [ Any ]] = {}
1275+ default : FixtureDefDict = {}
12751276 name2pseudofixturedef = node .stash .setdefault (
12761277 name2pseudofixturedef_key , default
12771278 )
You can’t perform that action at this time.
0 commit comments