@@ -854,8 +854,7 @@ p.f(1)
854854from p.a import f
855855[file p/a.py]
856856def f(x: str) -> None: pass
857- [delete p/__init__.py.2]
858- [delete p/a.py.2]
857+ [delete p.2]
859858[out]
860859main:2: error: Argument 1 to "f" has incompatible type "int"; expected "str"
861860==
@@ -870,7 +869,7 @@ p.a.f(1)
870869[file p/a.py]
871870def f(x: str) -> None: pass
872871[delete p/a.py.2]
873- [delete p/__init__.py .3]
872+ [delete p.3]
874873[builtins fixtures/module.pyi]
875874[out]
876875main:3: error: Argument 1 to "f" has incompatible type "int"; expected "str"
@@ -884,25 +883,26 @@ main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missin
884883main:2: error: Cannot find implementation or library stub for module named "p"
885884
886885[case testDeletePackage4]
886+ # flags: --namespace-packages
887887import p.a
888888p.a.f(1)
889889[file p/a.py]
890890def f(x: str) -> None: pass
891891[file p/__init__.py]
892892[delete p/__init__.py.2]
893- [delete p/a.py .3]
893+ [delete p.3]
894894[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"
896896==
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: Import of "p.a" ignored
898+ main:2: note: (Using --follow-imports=error, module not passed on command line)
900899==
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"
900+ main:2 : error: Cannot find implementation or library stub for module named "p.a"
901+ main:2 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
902+ main:2 : error: Cannot find implementation or library stub for module named "p"
904903
905904[case testDeletePackage5]
905+ # flags: --namespace-packages
906906# cmd1: mypy main p/a.py p/__init__.py
907907# cmd2: mypy main p/a.py
908908# cmd3: mypy main
@@ -913,20 +913,20 @@ p.a.f(1)
913913def f(x: str) -> None: pass
914914[file p/__init__.py]
915915[delete p/__init__.py.2]
916- [delete p/a.py .3]
916+ [delete p.3]
917917[out]
918- main:6 : error: Argument 1 to "f" has incompatible type "int"; expected "str"
918+ main:7 : error: Argument 1 to "f" has incompatible type "int"; expected "str"
919919==
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"
920+ main:6: error: Import of "p.a" ignored
921+ main:6: note: (Using --follow-imports=error, module not passed on command line)
923922==
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"
923+ main:6 : error: Cannot find implementation or library stub for module named "p.a"
924+ main:6 : note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
925+ main:6 : error: Cannot find implementation or library stub for module named "p"
927926
928927
929928[case testDeletePackage6]
929+ # flags: --namespace-packages
930930# cmd1: mypy p/a.py p/b.py p/__init__.py
931931# cmd2: mypy p/a.py p/b.py
932932# cmd3: mypy p/a.py p/b.py
@@ -943,8 +943,8 @@ f(12)
943943[out]
944944p/b.py:2: error: Argument 1 to "f" has incompatible type "int"; expected "str"
945945==
946- p/b.py:1: error: Cannot find implementation or library stub for module named "p.a"
947- p/b.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing- imports
946+ p/b.py:1: error: Import of "p.a" ignored
947+ p/b.py:1: note: (Using --follow- imports=error, module not passed on command line)
948948==
949949p/b.py:2: error: Argument 1 to "f" has incompatible type "int"; expected "str"
950950
0 commit comments