File: check-plugin-error-codes.test

package info (click to toggle)
mypy 1.19.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,412 kB
  • sloc: python: 114,754; ansic: 13,343; cpp: 11,380; makefile: 257; sh: 28
file content (32 lines) | stat: -rw-r--r-- 838 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[case testCustomErrorCodeFromPluginIsTargetable]
# flags: --config-file tmp/mypy.ini --show-error-codes

def main() -> None:
    return
main() # E: Custom error  [custom]

[file mypy.ini]
\[mypy]
plugins=<ROOT>/test-data/unit/plugins/custom_errorcode.py

[case testCustomErrorCodeCanBeDisabled]
# flags: --config-file tmp/mypy.ini --show-error-codes --disable-error-code=custom

def main() -> None:
    return
main()  # no output expected when disabled

[file mypy.ini]
\[mypy]
plugins=<ROOT>/test-data/unit/plugins/custom_errorcode.py

[case testCustomErrorCodeCanBeReenabled]
# flags: --config-file tmp/mypy.ini --show-error-codes --disable-error-code=custom --enable-error-code=custom

def main() -> None:
    return
main() # E: Custom error  [custom]

[file mypy.ini]
\[mypy]
plugins=<ROOT>/test-data/unit/plugins/custom_errorcode.py