| 1 |
[case testCustomErrorCodeFromPluginIsTargetable] |
| 2 |
# flags: --config-file tmp/mypy.ini --show-error-codes |
| 3 |
|
| 4 |
def main() -> None: |
| 5 |
return |
| 6 |
main() # E: Custom error [custom] |
| 7 |
|
| 8 |
[file mypy.ini] |
| 9 |
\[mypy] |
| 10 |
plugins=<ROOT>/test-data/unit/plugins/custom_errorcode.py |
| 11 |
|
| 12 |
[case testCustomErrorCodeCanBeDisabled] |
| 13 |
# flags: --config-file tmp/mypy.ini --show-error-codes --disable-error-code=custom |
| 14 |
|
| 15 |
def main() -> None: |
| 16 |
return |
| 17 |
main() # no output expected when disabled |
| 18 |
|
| 19 |
[file mypy.ini] |
| 20 |
\[mypy] |
| 21 |
plugins=<ROOT>/test-data/unit/plugins/custom_errorcode.py |
| 22 |
|
| 23 |
[case testCustomErrorCodeCanBeReenabled] |
| 24 |
# flags: --config-file tmp/mypy.ini --show-error-codes --disable-error-code=custom --enable-error-code=custom |
| 25 |
|
| 26 |
def main() -> None: |
| 27 |
return |
| 28 |
main() # E: Custom error [custom] |
| 29 |
|
| 30 |
[file mypy.ini] |
| 31 |
\[mypy] |
| 32 |
plugins=<ROOT>/test-data/unit/plugins/custom_errorcode.py |