Skip to content

Commit 7119f75

Browse files
author
Guido van Rossum
committed
Add unittest by @elazarg
1 parent 33a8060 commit 7119f75

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test-data/unit/check-modules.test

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,3 +1191,27 @@ pass
11911191
[file b]
11921192
pass
11931193
[out]
1194+
1195+
[case testTypeCheckPrio]
1196+
# cmd: mypy -m part1 part2 part3 part4
1197+
1198+
[file part1.py]
1199+
from part3 import Thing
1200+
class FirstThing: pass
1201+
1202+
[file part2.py]
1203+
from part4 import part4_thing as Thing
1204+
1205+
[file part3.py]
1206+
from part2 import Thing
1207+
reveal_type(Thing)
1208+
1209+
[file part4.py]
1210+
from typing import TYPE_CHECKING
1211+
if TYPE_CHECKING:
1212+
from part1 import FirstThing
1213+
def part4_thing(a: int) -> str: pass
1214+
1215+
[builtins fixtures/bool.pyi]
1216+
[out]
1217+
tmp/part3.py:2: error: Revealed type is 'def (a: builtins.int) -> builtins.str'

0 commit comments

Comments
 (0)