Skip to content

Commit a4fa65a

Browse files
Apply review comment
and fix a couple of Mypy issues
1 parent c962339 commit a4fa65a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/_pytest/assertion/rewrite.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pathlib import Path
1818
from pathlib import PurePath
1919
from typing import Callable
20+
from typing import DefaultDict
2021
from typing import Dict
2122
from typing import IO
2223
from typing import Iterable
@@ -668,9 +669,9 @@ def __init__(
668669
else:
669670
self.enable_assertion_pass_hook = False
670671
self.source = source
671-
self.scope: tuple[ast.AST, ...] = ()
672-
self.variables_overwrite: defaultdict[
673-
tuple[ast.AST, ...], Dict[str, str]
672+
self.scope: Tuple[ast.AST, ...] = ()
673+
self.variables_overwrite: DefaultDict[
674+
Tuple[ast.AST, ...], Dict[str, str]
674675
] = defaultdict(dict)
675676

676677
def run(self, mod: ast.Module) -> None:

src/_pytest/python.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
from _pytest.deprecated import INSTANCE_COLLECTOR
6161
from _pytest.deprecated import NOSE_SUPPORT_METHOD
6262
from _pytest.fixtures import _get_direct_parametrize_args
63-
from _pytest.fixtures import FixtureDef
6463
from _pytest.fixtures import FuncFixtureInfo
6564
from _pytest.fixtures import get_scope_node
6665
from _pytest.fixtures import IdentityFixtureDef
@@ -1189,7 +1188,7 @@ def id(self) -> str:
11891188

11901189

11911190
# Used for storing pseudo fixturedefs for direct parametrization.
1192-
name2pseudofixturedef_key = StashKey[Dict[str, FixtureDef[Any]]]()
1191+
name2pseudofixturedef_key = StashKey[Dict[str, IdentityFixtureDef[Any]]]()
11931192

11941193

11951194
@final
@@ -1379,7 +1378,7 @@ def parametrize(
13791378
if node is None:
13801379
name2pseudofixturedef = None
13811380
else:
1382-
default: Dict[str, FixtureDef[Any]] = {}
1381+
default: Dict[str, IdentityFixtureDef[Any]] = {}
13831382
name2pseudofixturedef = node.stash.setdefault(
13841383
name2pseudofixturedef_key, default
13851384
)

0 commit comments

Comments
 (0)