Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case for disable_error_code config file option #9538

Merged
merged 4 commits into from Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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