Skip to content

Commit 89de623

Browse files
authored
Add test case for disable_error_code config file option (#9538)
1 parent 49a8c10 commit 89de623

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

mypy/config_parser.py

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def check_follow_imports(choice: str) -> str:
9494
'plugins': lambda s: [p.strip() for p in s.split(',')],
9595
'always_true': lambda s: [p.strip() for p in s.split(',')],
9696
'always_false': lambda s: [p.strip() for p in s.split(',')],
97+
'disable_error_code': lambda s: [p.strip() for p in s.split(',')],
98+
'enable_error_code': lambda s: [p.strip() for p in s.split(',')],
9799
'package_root': lambda s: [p.strip() for p in s.split(',')],
98100
'cache_dir': expand_path,
99101
'python_executable': expand_path,

test-data/unit/check-flags.test

+9
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,15 @@ always_true = YOLO1, YOLO
10781078
always_false = BLAH, BLAH1
10791079
[builtins fixtures/bool.pyi]
10801080

1081+
[case testDisableErrorCodeConfigFile]
1082+
# flags: --config-file tmp/mypy.ini --disallow-untyped-defs
1083+
import foo
1084+
def bar():
1085+
pass
1086+
[file mypy.ini]
1087+
\[mypy]
1088+
disable_error_code = import, no-untyped-def
1089+
10811090
[case testCheckDisallowAnyGenericsNamedTuple]
10821091
# flags: --disallow-any-generics
10831092
from typing import NamedTuple

0 commit comments

Comments
 (0)