Skip to content

Commit 120cbaa

Browse files
committed
New semantic analyzer: update tests not to mention fixed issue
These recursive type definitions no longer cause crashes. Closes #6445.
1 parent d1b6f7f commit 120cbaa

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

test-data/unit/check-classes.test

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4355,7 +4355,6 @@ class A(Tuple[int, str]): pass
43554355
-- -----------------------
43564356

43574357
[case testCrashOnSelfRecursiveNamedTupleVar]
4358-
# FIXME: #6445
43594358
# flags: --new-semantic-analyzer
43604359
from typing import NamedTuple
43614360

@@ -4364,15 +4363,13 @@ n: N
43644363
reveal_type(n) # N: Revealed type is 'Tuple[Any, fallback=__main__.N]'
43654364

43664365
[case testCrashOnSelfRecursiveTypedDictVar]
4367-
# FIXME: #6445
43684366
from mypy_extensions import TypedDict
43694367

43704368
A = TypedDict('A', {'a': 'A'}) # type: ignore
43714369
a: A
43724370
[builtins fixtures/isinstancelist.pyi]
43734371

43744372
[case testCrashInJoinOfSelfRecursiveNamedTuples]
4375-
# FIXME: #6445
43764373
# flags: --new-semantic-analyzer
43774374
from typing import NamedTuple
43784375

@@ -4387,7 +4384,6 @@ lst = [n, m]
43874384
[builtins fixtures/isinstancelist.pyi]
43884385

43894386
[case testCorrectJoinOfSelfRecursiveTypedDicts]
4390-
# FIXME: #6445
43914387
# flags: --new-semantic-analyzer
43924388
from mypy_extensions import TypedDict
43934389

test-data/unit/check-flags.test

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,25 +1053,23 @@ always_false = BLAH, BLAH1
10531053
[builtins fixtures/bool.pyi]
10541054

10551055
[case testCheckDisallowAnyGenericsNamedTuple]
1056-
# Crashes on new semantic analyzer: https://github.com/python/mypy/issues/6445
1057-
# flags: --disallow-any-generics --no-new-semantic-analyzer
1056+
# flags: --disallow-any-generics --new-semantic-analyzer
10581057
from typing import NamedTuple
10591058

10601059
N = NamedTuple('N', [('x', N)]) # type: ignore
10611060
n: N
10621061
[out]
10631062

10641063
[case testCheckDisallowAnyGenericsTypedDict]
1065-
# Crashes on new semantic analyzer: https://github.com/python/mypy/issues/6445
1066-
# flags: --disallow-any-generics --no-new-semantic-analyzer
1064+
# flags: --disallow-any-generics --new-semantic-analyzer
10671065
from typing import Dict, Any, Optional
10681066
from mypy_extensions import TypedDict
10691067

1070-
VarsDict = Dict[str, Any]
1071-
HostsDict = Dict[str, Optional[VarsDict]]
1068+
VarsDict = Dict[str, Any] # type: ignore
1069+
HostsDict = Dict[str, Optional[VarsDict]] # type: ignore
10721070

1073-
GroupDataDict = TypedDict( # type: ignore
1074-
"GroupDataDict", {"children": "GroupsDict",
1071+
GroupDataDict = TypedDict(
1072+
"GroupDataDict", {"children": "GroupsDict", # type: ignore
10751073
"vars": VarsDict,
10761074
"hosts": HostsDict}, total=False
10771075
)

test-data/unit/check-unions.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,6 @@ def takes_int(arg: int) -> None: pass
957957
takes_int(x) # E: Argument 1 to "takes_int" has incompatible type <union: 6 items>; expected "int"
958958

959959
[case testRecursiveForwardReferenceInUnion]
960-
# https://github.com/python/mypy/issues/6445
961960
# flags: --new-semantic-analyzer
962961
from typing import List, Union
963962
MYTYPE = List[Union[str, "MYTYPE"]]

0 commit comments

Comments
 (0)