Skip to content

Commit a078583

Browse files
author
Guido van Rossum
committed
Add unittest by @elazarg
1 parent 8bab47b commit a078583

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
@@ -1313,3 +1313,27 @@ pass
13131313
[file b]
13141314
pass
13151315
[out]
1316+
1317+
[case testTypeCheckPrio]
1318+
# cmd: mypy -m part1 part2 part3 part4
1319+
1320+
[file part1.py]
1321+
from part3 import Thing
1322+
class FirstThing: pass
1323+
1324+
[file part2.py]
1325+
from part4 import part4_thing as Thing
1326+
1327+
[file part3.py]
1328+
from part2 import Thing
1329+
reveal_type(Thing)
1330+
1331+
[file part4.py]
1332+
from typing import TYPE_CHECKING
1333+
if TYPE_CHECKING:
1334+
from part1 import FirstThing
1335+
def part4_thing(a: int) -> str: pass
1336+
1337+
[builtins fixtures/bool.pyi]
1338+
[out]
1339+
tmp/part3.py:2: error: Revealed type is 'def (a: builtins.int) -> builtins.str'

0 commit comments

Comments
 (0)