-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Bug Report
When using pytest-mypy to test some dynamically determined types (with generics) results in a false-positive error in CI, because mypy's exit code becomes 1 when there are no errors but only reveal_type outputs.
To Reproduce
Just write an arbitrary Python file that has no type errors and put reveal_type() to any one of the identifiers.
Run mypy against that file and check the exit code.
I'd like to keep reveal_type() in my code, to test a mixture of runtime type validation and static typing results using typeguard, generics, and pytest-mypy plugin.
Expected Behavior
When there are no errors but only some reveal_type outputs, mypy executable should set the exit code 0.
Actual Behavior
It sets the exit code 1, breaking my CI.

Your Environment
- Mypy version used: 0.800
- Mypy command-line flags and options:
[mypy]
ignore_missing_imports = true
mypy_path = stubs,src
namespace_packages = true
explicit_package_bases = true- Python version used: 3.9.1
- Operating system and version: Ubuntu 20.04