Skip to content

Untyped decorator makes function "foo" untyped #11763

Closed
@adamjstewart

Description

@adamjstewart

Bug Report

Our CI tests started failing with the mypy 0.920 release. It looks like a new feature is checking decorator types? This may not be a bug in mypy but a lack of documentation explaining the new feature. I couldn't find any release notes or CHANGELOG explaining this feature.

To Reproduce

  1. Create a new file:
import pytest

@pytest.fixture
def foo() -> None:
    pass
  1. Run mypy: mypy --strict --ignore-missing-imports foo.py

Expected Behavior

Since the function is correctly typed, I wouldn't expect mypy to complain, but there must be a new feature triggering this. Is it because the pytest library is untyped? Normally mypy skips those kind of things.

Actual Behavior

Mypy complains with an error message I can't find in the documentation:

foo.py:3: error: Untyped decorator makes function "foo" untyped

Your Environment

  • Mypy version used: 0.920
  • Mypy command-line flags: --strict --ignore-missing-imports
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.9.9
  • Operating system and version: macOS 10.15.7

@calebrob6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions