8000 Using reveal_type with no errors should return exit code 0 · Issue #10013 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content
Using reveal_type with no errors should return exit code 0 #10013
Closed
@achimnol

Description

@achimnol

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.
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0