Skip to content

Commit

Permalink
Add unittest by @elazarg
Browse files Browse the repository at this point in the history
  • Loading branch information
Guido van Rossum committed Sep 25, 2016
1 parent 22efba6 commit 1a80349
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test-data/unit/check-modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -1191,3 +1191,27 @@ pass
[file b]
pass
[out]

[case testTypeCheckPrio]
# cmd: mypy -m part1 part2 part3 part4

[file part1.py]
from part3 import Thing
class FirstThing: pass

[file part2.py]
from part4 import part4_thing as Thing

[file part3.py]
from part2 import Thing
reveal_type(Thing)

[file part4.py]
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from part1 import FirstThing
def part4_thing(a: int) -> str: pass

[builtins fixtures/bool.pyi]
[out]
tmp/part3.py:2: error: Revealed type is 'def (a: builtins.int) -> builtins.str'

0 comments on commit 1a80349

Please sign in to comment.