Skip to content

Commit

Permalink
cmdline: add to the test
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Oct 31, 2020
1 parent fd16f84 commit 361653b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test-data/unit/cmdline.test
Original file line number Diff line number Diff line change
Expand Up @@ -810,15 +810,19 @@ def bar(a: int, b: int) -> str:
src/anamespace/foo/bar.py:2: error: Incompatible return value type (got "int", expected "str")

[case testNestedPEP420Packages]
# cmd: mypy -p bottles --namespace-packages
[file bottles/jars/secret/glitter.py]
# cmd: mypy -p pkg --namespace-packages
[file pkg/a1/b/c/d/e.py]
x = 0 # type: str
[file bottles/jars/sprinkle.py]
from bottles.jars.secret.glitter import x
x + 1
[file pkg/a1/b/f.py]
from pkg.a1.b.c.d.e import x
[file pkg/a2/__init__.py]
[file pkg/a2/b/c/d/e.py]
x = 0 # type: str
[file pkg/a2/b/f.py]
from pkg.a1.b.c.d.e import x
[out]
bottles/jars/secret/glitter.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
bottles/jars/sprinkle.py:2: error: Unsupported operand types for + ("str" and "int")
pkg/a1/b/c/d/e.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
pkg/a2/b/c/d/e.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")

[case testFollowImportStubs1]
# cmd: mypy main.py
Expand Down

0 comments on commit 361653b

Please sign in to comment.