parent
c96233919f
commit
95f53e32d7
|
@ -17,6 +17,7 @@ from collections import defaultdict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pathlib import PurePath
|
from pathlib import PurePath
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
from typing import DefaultDict
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
from typing import IO
|
from typing import IO
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
@ -668,9 +669,9 @@ class AssertionRewriter(ast.NodeVisitor):
|
||||||
else:
|
else:
|
||||||
self.enable_assertion_pass_hook = False
|
self.enable_assertion_pass_hook = False
|
||||||
self.source = source
|
self.source = source
|
||||||
self.scope: tuple[ast.AST, ...] = ()
|
self.scope: Tuple[ast.AST, ...] = ()
|
||||||
self.variables_overwrite: defaultdict[
|
self.variables_overwrite: DefaultDict[
|
||||||
tuple[ast.AST, ...], Dict[str, str]
|
Tuple[ast.AST, ...], Dict[str, str]
|
||||||
] = defaultdict(dict)
|
] = defaultdict(dict)
|
||||||
|
|
||||||
def run(self, mod: ast.Module) -> None:
|
def run(self, mod: ast.Module) -> None:
|
||||||
|
|
|
@ -60,7 +60,6 @@ from _pytest.deprecated import check_ispytest
|
||||||
from _pytest.deprecated import INSTANCE_COLLECTOR
|
from _pytest.deprecated import INSTANCE_COLLECTOR
|
||||||
from _pytest.deprecated import NOSE_SUPPORT_METHOD
|
from _pytest.deprecated import NOSE_SUPPORT_METHOD
|
||||||
from _pytest.fixtures import _get_direct_parametrize_args
|
from _pytest.fixtures import _get_direct_parametrize_args
|
||||||
from _pytest.fixtures import FixtureDef
|
|
||||||
from _pytest.fixtures import FuncFixtureInfo
|
from _pytest.fixtures import FuncFixtureInfo
|
||||||
from _pytest.fixtures import get_scope_node
|
from _pytest.fixtures import get_scope_node
|
||||||
from _pytest.fixtures import IdentityFixtureDef
|
from _pytest.fixtures import IdentityFixtureDef
|
||||||
|
@ -1189,7 +1188,7 @@ class CallSpec2:
|
||||||
|
|
||||||
|
|
||||||
# Used for storing pseudo fixturedefs for direct parametrization.
|
# Used for storing pseudo fixturedefs for direct parametrization.
|
||||||
name2pseudofixturedef_key = StashKey[Dict[str, FixtureDef[Any]]]()
|
name2pseudofixturedef_key = StashKey[Dict[str, IdentityFixtureDef[Any]]]()
|
||||||
|
|
||||||
|
|
||||||
@final
|
@final
|
||||||
|
@ -1379,7 +1378,7 @@ class Metafunc:
|
||||||
if node is None:
|
if node is None:
|
||||||
name2pseudofixturedef = None
|
name2pseudofixturedef = None
|
||||||
else:
|
else:
|
||||||
default: Dict[str, FixtureDef[Any]] = {}
|
default: Dict[str, IdentityFixtureDef[Any]] = {}
|
||||||
name2pseudofixturedef = node.stash.setdefault(
|
name2pseudofixturedef = node.stash.setdefault(
|
||||||
name2pseudofixturedef_key, default
|
name2pseudofixturedef_key, default
|
||||||
)
|
)
|
||||||
|
|
|
@ -4571,8 +4571,8 @@ def test_fixture_info_after_dynamic_parametrize(pytester: Pytester) -> None:
|
||||||
assert fixture2 in (4, 5)
|
assert fixture2 in (4, 5)
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
res = pytester.inline_run()
|
res = pytester.runpytest()
|
||||||
res.assertoutcome(passed=2)
|
res.assert_outcomes(passed=2)
|
||||||
|
|
||||||
|
|
||||||
def test_reordering_after_dynamic_parametrize(pytester: Pytester):
|
def test_reordering_after_dynamic_parametrize(pytester: Pytester):
|
||||||
|
@ -4720,8 +4720,8 @@ def test_dont_recompute_dependency_tree_if_no_direct_dynamic_parametrize(
|
||||||
assert calls[6].kwargs["parentnode"].nodeid.endswith("test")
|
assert calls[6].kwargs["parentnode"].nodeid.endswith("test")
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
reprec = pytester.inline_run()
|
reprec = pytester.runpytest()
|
||||||
reprec.assertoutcome(passed=6)
|
reprec.assert_outcomes(passed=6)
|
||||||
|
|
||||||
|
|
||||||
def test_deduplicate_names() -> None:
|
def test_deduplicate_names() -> None:
|
||||||
|
|
Loading…
Reference in New Issue