File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 95
95
# The parameters that a fixture function receives.
96
96
FixtureParams = ParamSpec ("FixtureParams" )
97
97
98
+ # A dict of fixture name -> its FixtureDef.
99
+ FixtureDefDict : TypeAlias = dict [str , "FixtureDef[FixtureValue]" ]
100
+
98
101
# The type of fixture function (type alias generic in fixture params and value).
99
102
_FixtureFunc : TypeAlias = Union [
100
103
Callable [FixtureParams , FixtureValue ],
@@ -370,7 +373,7 @@ def __init__(
370
373
pyfuncitem : Function ,
371
374
fixturename : str | None ,
372
375
arg2fixturedefs : dict [str , Sequence [FixtureDef [Any ]]],
373
- fixture_defs : dict [ str , FixtureDef [ Any ] ],
376
+ fixture_defs : FixtureDefDict [ Any ],
374
377
* ,
375
378
_ispytest : bool = False ,
376
379
) -> None :
Original file line number Diff line number Diff line change 51
51
from _pytest .config .argparsing import Parser
52
52
from _pytest .deprecated import check_ispytest
53
53
from _pytest .fixtures import FixtureDef
54
+ from _pytest .fixtures import FixtureDefDict
54
55
from _pytest .fixtures import FixtureRequest
55
56
from _pytest .fixtures import FuncFixtureInfo
56
57
from _pytest .fixtures import get_scope_node
@@ -1085,7 +1086,7 @@ def get_direct_param_fixture_func(request: FixtureRequest) -> Any:
1085
1086
1086
1087
1087
1088
# Used for storing pseudo fixturedefs for direct parametrization.
1088
- name2pseudofixturedef_key = StashKey [dict [ str , FixtureDef [ Any ] ]]()
1089
+ name2pseudofixturedef_key = StashKey [FixtureDefDict [ Any ]]()
1089
1090
1090
1091
1091
1092
@final
@@ -1271,7 +1272,7 @@ def parametrize(
1271
1272
if node is None :
1272
1273
name2pseudofixturedef = None
1273
1274
else :
1274
- default : dict [ str , FixtureDef [ Any ] ] = {}
1275
+ default : FixtureDefDict [ Any ] = {}
1275
1276
name2pseudofixturedef = node .stash .setdefault (
1276
1277
name2pseudofixturedef_key , default
1277
1278
)
You can’t perform that action at this time.
0 commit comments