@@ -854,8 +854,7 @@ p.f(1)
854
854
from p.a import f
855
855
[file p/a.py]
856
856
def f(x: str) -> None: pass
857
- [delete p/__init__.py.2]
858
- [delete p/a.py.2]
857
+ [delete p.2]
859
858
[out]
860
859
main:2: error: Argument 1 to "f" has incompatible type "int"; expected "str"
861
860
==
@@ -870,7 +869,7 @@ p.a.f(1)
870
869
[file p/a.py]
871
870
def f(x: str) -> None: pass
872
871
[delete p/a.py.2]
873
- [delete p/__init__.py .3]
872
+ [delete p.3]
874
873
[builtins fixtures/module.pyi]
875
874
[out]
876
875
main:3: error: Argument 1 to "f" has incompatible type "int"; expected "str"
@@ -884,52 +883,55 @@ main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missin
884
883
main:2: error: Cannot find implementation or library stub for module named "p"
885
884
886
885
[case testDeletePackage4]
886
+ # flags: --no-namespace-packages
887
887
import p.a
888
888
p.a.f(1)
889
889
[file p/a.py]
890
890
def f(x: str) -> None: pass
891
891
[file p/__init__.py]
892
892
[delete p/__init__.py.2]
893
- [delete p/a.py .3]
893
+ [delete p.3]
894
894
[out]
895
- main:2 : error: Argument 1 to "f" has incompatible type "int"; expected "str"
895
+ main:3 : error: Argument 1 to "f" has incompatible type "int"; expected "str"
896
896
==
897
- main:1 : error: Cannot find implementation or library stub for module named "p.a"
898
- main:1 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
899
- main:1 : error: Cannot find implementation or library stub for module named "p"
897
+ main:2 : error: Cannot find implementation or library stub for module named "p.a"
898
+ main:2 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
899
+ main:2 : error: Cannot find implementation or library stub for module named "p"
900
900
==
901
- main:1 : error: Cannot find implementation or library stub for module named "p.a"
902
- main:1 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
903
- main:1 : error: Cannot find implementation or library stub for module named "p"
901
+ main:2 : error: Cannot find implementation or library stub for module named "p.a"
902
+ main:2 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
903
+ main:2 : error: Cannot find implementation or library stub for module named "p"
904
904
905
905
[case testDeletePackage5]
906
- # cmd1: mypy main p/a.py p/__init__.py
907
- # cmd2: mypy main p/a.py
908
- # cmd3: mypy main
906
+ # flags: --no-namespace-packages
907
+ # cmd1: mypy -m main -m p.a -m p.__init__
908
+ # cmd2: mypy -m main -m p.a
909
+ # cmd3: mypy -m main
909
910
910
911
import p.a
911
912
p.a.f(1)
912
913
[file p/a.py]
913
914
def f(x: str) -> None: pass
914
915
[file p/__init__.py]
915
916
[delete p/__init__.py.2]
916
- [delete p/a.py .3]
917
+ [delete p.3]
917
918
[out]
918
- main:6 : error: Argument 1 to "f" has incompatible type "int"; expected "str"
919
+ main:7 : error: Argument 1 to "f" has incompatible type "int"; expected "str"
919
920
==
920
- main:5 : error: Cannot find implementation or library stub for module named "p.a"
921
- main:5 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
922
- main:5 : error: Cannot find implementation or library stub for module named "p"
921
+ main:6 : error: Cannot find implementation or library stub for module named "p.a"
922
+ main:6 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
923
+ main:6 : error: Cannot find implementation or library stub for module named "p"
923
924
==
924
- main:5 : error: Cannot find implementation or library stub for module named "p.a"
925
- main:5 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
926
- main:5 : error: Cannot find implementation or library stub for module named "p"
925
+ main:6 : error: Cannot find implementation or library stub for module named "p.a"
926
+ main:6 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
927
+ main:6 : error: Cannot find implementation or library stub for module named "p"
927
928
928
929
929
930
[case testDeletePackage6]
930
- # cmd1: mypy p/a.py p/b.py p/__init__.py
931
- # cmd2: mypy p/a.py p/b.py
932
- # cmd3: mypy p/a.py p/b.py
931
+ # flags: --no-namespace-packages
932
+ # cmd1: mypy -m p.a -m p.b -m p.__init__
933
+ # cmd2: mypy -m p.a -m p.b
934
+ # cmd3: mypy -m p.a -m p.b
933
935
[file p/a.py]
934
936
def f(x: str) -> None: pass
935
937
[file p/b.py]
0 commit comments