Skip to content

Commit

Permalink
Add test case for disable_error_code config file option (#9538)
Browse files Browse the repository at this point in the history
  • Loading branch information
amikrop authored and JukkaL committed Oct 8, 2020
1 parent 9503938 commit 58cbfb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mypy/config_parser.py
Expand Up @@ -94,6 +94,8 @@ def check_follow_imports(choice: str) -> str:
'plugins': lambda s: [p.strip() for p in s.split(',')],
'always_true': lambda s: [p.strip() for p in s.split(',')],
'always_false': lambda s: [p.strip() for p in s.split(',')],
'disable_error_code': lambda s: [p.strip() for p in s.split(',')],
'enable_error_code': lambda s: [p.strip() for p in s.split(',')],
'package_root': lambda s: [p.strip() for p in s.split(',')],
'cache_dir': expand_path,
'python_executable': expand_path,
Expand Down
9 changes: 9 additions & 0 deletions test-data/unit/check-flags.test
Expand Up @@ -1078,6 +1078,15 @@ always_true = YOLO1, YOLO
always_false = BLAH, BLAH1
[builtins fixtures/bool.pyi]

[case testDisableErrorCodeConfigFile]
# flags: --config-file tmp/mypy.ini --disallow-untyped-defs
import foo
def bar():
pass
[file mypy.ini]
\[mypy]
disable_error_code = import, no-untyped-def

[case testCheckDisallowAnyGenericsNamedTuple]
# flags: --disallow-any-generics
from typing import NamedTuple
Expand Down

0 comments on commit 58cbfb4

Please sign in to comment.