@@ -1306,38 +1306,37 @@ def fizz(self): pass
13061306 """ ,
13071307 error = None ,
13081308 )
1309- if sys .version_info >= (3 , 10 ):
1310- yield Case (
1311- stub = """
1312- Q = Dict[str, str]
1313- R = dict[int, int]
1314- S = Tuple[int, int]
1315- T = tuple[str, str]
1316- U = int | str
1317- V = Union[int, str]
1318- W = typing.Callable[[str], bool]
1319- Z = collections.abc.Callable[[str], bool]
1320- QQ = typing.Iterable[str]
1321- RR = collections.abc.Iterable[str]
1322- MM = typing.Match[str]
1323- MMM = re.Match[str]
1324- """ ,
1325- runtime = """
1326- Q = dict[str, str]
1327- R = dict[int, int]
1328- S = tuple[int, int]
1329- T = tuple[str, str]
1330- U = int | str
1331- V = int | str
1332- W = collections.abc.Callable[[str], bool]
1333- Z = collections.abc.Callable[[str], bool]
1334- QQ = collections.abc.Iterable[str]
1335- RR = collections.abc.Iterable[str]
1336- MM = re.Match[str]
1337- MMM = re.Match[str]
1338- """ ,
1339- error = None ,
1340- )
1309+ yield Case (
1310+ stub = """
1311+ Q = Dict[str, str]
1312+ R = dict[int, int]
1313+ S = Tuple[int, int]
1314+ T = tuple[str, str]
1315+ U = int | str
1316+ V = Union[int, str]
1317+ W = typing.Callable[[str], bool]
1318+ Z = collections.abc.Callable[[str], bool]
1319+ QQ = typing.Iterable[str]
1320+ RR = collections.abc.Iterable[str]
1321+ MM = typing.Match[str]
1322+ MMM = re.Match[str]
1323+ """ ,
1324+ runtime = """
1325+ Q = dict[str, str]
1326+ R = dict[int, int]
1327+ S = tuple[int, int]
1328+ T = tuple[str, str]
1329+ U = int | str
1330+ V = int | str
1331+ W = collections.abc.Callable[[str], bool]
1332+ Z = collections.abc.Callable[[str], bool]
1333+ QQ = collections.abc.Iterable[str]
1334+ RR = collections.abc.Iterable[str]
1335+ MM = re.Match[str]
1336+ MMM = re.Match[str]
1337+ """ ,
1338+ error = None ,
1339+ )
13411340
13421341 @collect_cases
13431342 def test_enum (self ) -> Iterator [Case ]:
@@ -2332,13 +2331,10 @@ def test_type_var(self) -> Iterator[Case]:
23322331 )
23332332 yield Case (stub = "A = TypeVar('A')" , runtime = "A = TypeVar('A')" , error = None )
23342333 yield Case (stub = "B = TypeVar('B')" , runtime = "B = 5" , error = "B" )
2335- if sys .version_info >= (3 , 10 ):
2336- yield Case (
2337- stub = "from typing import ParamSpec" ,
2338- runtime = "from typing import ParamSpec" ,
2339- error = None ,
2340- )
2341- yield Case (stub = "C = ParamSpec('C')" , runtime = "C = ParamSpec('C')" , error = None )
2334+ yield Case (
2335+ stub = "from typing import ParamSpec" , runtime = "from typing import ParamSpec" , error = None
2336+ )
2337+ yield Case (stub = "C = ParamSpec('C')" , runtime = "C = ParamSpec('C')" , error = None )
23422338
23432339 @collect_cases
23442340 def test_metaclass_match (self ) -> Iterator [Case ]:
@@ -2862,10 +2858,7 @@ def myfunction(arg: str, /) -> None: ...
28622858 stub = result .files ["__main__" ].names ["myfunction" ].node
28632859 assert isinstance (stub , nodes .OverloadedFuncDef )
28642860 sig = mypy .stubtest .Signature .from_overloadedfuncdef (stub )
2865- if sys .version_info >= (3 , 10 ):
2866- assert str (sig ) == "def (arg: builtins.int | builtins.str)"
2867- else :
2868- assert str (sig ) == "def (arg: Union[builtins.int, builtins.str])"
2861+ assert str (sig ) == "def (arg: builtins.int | builtins.str)"
28692862
28702863 def test_config_file (self ) -> None :
28712864 runtime = "temp = 5\n "
0 commit comments