Skip to content

Commit

Permalink
Apply review comment
Browse files Browse the repository at this point in the history
and fix a couple of Mypy issues
  • Loading branch information
sadra-barikbin committed Dec 15, 2023
1 parent c962339 commit a4fa65a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/_pytest/assertion/rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pathlib import Path
from pathlib import PurePath
from typing import Callable
from typing import DefaultDict
from typing import Dict
from typing import IO
from typing import Iterable
Expand Down Expand Up @@ -668,9 +669,9 @@ def __init__(
else:
self.enable_assertion_pass_hook = False
self.source = source
self.scope: tuple[ast.AST, ...] = ()
self.variables_overwrite: defaultdict[
tuple[ast.AST, ...], Dict[str, str]
self.scope: Tuple[ast.AST, ...] = ()
self.variables_overwrite: DefaultDict[
Tuple[ast.AST, ...], Dict[str, str]
] = defaultdict(dict)

def run(self, mod: ast.Module) -> None:
Expand Down
5 changes: 2 additions & 3 deletions src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
from _pytest.deprecated import INSTANCE_COLLECTOR
from _pytest.deprecated import NOSE_SUPPORT_METHOD
from _pytest.fixtures import _get_direct_parametrize_args
from _pytest.fixtures import FixtureDef
from _pytest.fixtures import FuncFixtureInfo
from _pytest.fixtures import get_scope_node
from _pytest.fixtures import IdentityFixtureDef
Expand Down Expand Up @@ -1189,7 +1188,7 @@ def id(self) -> str:


# Used for storing pseudo fixturedefs for direct parametrization.
name2pseudofixturedef_key = StashKey[Dict[str, FixtureDef[Any]]]()
name2pseudofixturedef_key = StashKey[Dict[str, IdentityFixtureDef[Any]]]()


@final
Expand Down Expand Up @@ -1379,7 +1378,7 @@ def parametrize(
if node is None:
name2pseudofixturedef = None
else:
default: Dict[str, FixtureDef[Any]] = {}
default: Dict[str, IdentityFixtureDef[Any]] = {}

Check warning on line 1381 in src/_pytest/python.py

View check run for this annotation

Codecov / codecov/patch

src/_pytest/python.py#L1381

Added line #L1381 was not covered by tests
name2pseudofixturedef = node.stash.setdefault(
name2pseudofixturedef_key, default
)
Expand Down

0 comments on commit a4fa65a

Please sign in to comment.