@@ -972,6 +972,10 @@ x = Foo()
972
972
==
973
973
main:2: error: Too few arguments for "foo" of "Foo"
974
974
975
+ -- This series of tests is designed to test adding a new module that
976
+ -- doesn't appear in the cache, for cache mode. They aren't run only
977
+ -- in cache mode, though, because they are still perfectly good
978
+ -- regular tests.
975
979
[case testAddModuleAfterCache1]
976
980
# cmd: mypy main a.py
977
981
# cmd2: mypy main a.py b.py
@@ -1024,3 +1028,64 @@ import b, c, d, e, f, g
1024
1028
[file g.py.2]
1025
1029
[out]
1026
1030
==
1031
+
1032
+ [case testAddModuleAfterCache4]
1033
+ # cmd: mypy main a.py
1034
+ # cmd2: mypy main a.py b.py
1035
+ # cmd3: mypy main a.py b.py
1036
+ # flags: --ignore-missing-imports --follow-imports=skip
1037
+ import a
1038
+ import b
1039
+ [file a.py]
1040
+ def foo() -> None: pass
1041
+ [file b.py.2]
1042
+ import a
1043
+ a.foo(10)
1044
+ [file a.py.3]
1045
+ def foo(x: int) -> None: pass
1046
+ [out]
1047
+ ==
1048
+ b.py:2: error: Too many arguments for "foo"
1049
+ ==
1050
+
1051
+ [case testAddModuleAfterCache5]
1052
+ # cmd: mypy main a.py
1053
+ # cmd2: mypy main a.py b.py
1054
+ # cmd3: mypy main a.py b.py
1055
+ # flags: --ignore-missing-imports --follow-imports=skip
1056
+ import a
1057
+ import b
1058
+ [file a.py]
1059
+ def foo(x: int) -> None: pass
1060
+ [file a.py.2]
1061
+ def foo() -> None: pass
1062
+ [file b.py.2]
1063
+ import a
1064
+ a.foo(10)
1065
+ [file a.py.3]
1066
+ def foo(x: int) -> None: pass
1067
+ [out]
1068
+ ==
1069
+ b.py:2: error: Too many arguments for "foo"
1070
+ ==
1071
+
1072
+ [case testAddModuleAfterCache6]
1073
+ # cmd: mypy main a.py
1074
+ # cmd2: mypy main a.py b.py
1075
+ # cmd3: mypy main a.py b.py
1076
+ # flags: --ignore-missing-imports --follow-imports=skip
1077
+ import a
1078
+ [file a.py]
1079
+ import b
1080
+ b.foo()
1081
+ [file a.py.2]
1082
+ import b
1083
+ b.foo(0)
1084
+ [file b.py.2]
1085
+ def foo() -> None: pass
1086
+ [file b.py.3]
1087
+ def foo(x: int) -> None: pass
1088
+ [out]
1089
+ ==
1090
+ a.py:2: error: Too many arguments for "foo"
1091
+ ==
0 commit comments