Skip to content

Commit 31ffc1d

Browse files
committed
Add a bunch more tests
1 parent 79a4ca4 commit 31ffc1d

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

test-data/unit/fine-grained-modules.test

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,10 @@ x = Foo()
972972
==
973973
main:2: error: Too few arguments for "foo" of "Foo"
974974

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.
975979
[case testAddModuleAfterCache1]
976980
# cmd: mypy main a.py
977981
# cmd2: mypy main a.py b.py
@@ -1024,3 +1028,64 @@ import b, c, d, e, f, g
10241028
[file g.py.2]
10251029
[out]
10261030
==
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

Comments
 (0)