Skip to content

Commit 96638ed

Browse files
committed
Add a test of the in-file configuration override format
1 parent 9f82042 commit 96638ed

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test-data/unit/cmdline.test

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,38 @@ xy.py:1: error: Function is missing a type annotation
196196
xy.py:2: error: Call to untyped function "f" in typed context
197197
xx.py:1: error: Function is missing a type annotation
198198

199+
[case testInFileConfigSection]
200+
# cmd: mypy x.py y.py z.py
201+
[file mypy.ini]
202+
[[mypy]
203+
disallow_untyped_defs = True
204+
[file x.py]
205+
def f(a):
206+
pass
207+
def g(a: int) -> int:
208+
return f(a)
209+
[file y.py]
210+
# [[mypy]
211+
# disallow_untyped_defs = False
212+
def f(a):
213+
pass
214+
def g(a: int) -> int:
215+
return f(a)
216+
[file z.py]
217+
#
218+
# [[mypy]
219+
# disallow_untyped_calls = True
220+
#
221+
222+
def f(a):
223+
pass
224+
def g(a: int) -> int:
225+
return f(a)
226+
[out]
227+
z.py:6: error: Function is missing a type annotation
228+
z.py:9: error: Call to untyped function "f" in typed context
229+
x.py:1: error: Function is missing a type annotation
230+
199231
[case testMultipleGlobConfigSection]
200232
# cmd: mypy x.py y.py z.py
201233
[file mypy.ini]

0 commit comments

Comments
 (0)