Skip to content

ParamSpec appears to get lost with mock.patch() #18595

Closed as not planned
Closed as not planned
@Dreamsorcerer

Description

@Dreamsorcerer

Bug Report

It appears that ParamSpec is used in typeshed (python/typeshed#10325), but when using --disallow-any-decorated it seems to be complaining that the parameters are gone.

To Reproduce

from unittest import mock

@mock.patch("aiohttp.connector.ClientRequest")
def test_connect(foo: int) -> None:
    ...

Actual Behavior

error: Type of decorated function contains type "Any"
("Callable[..., None]")  [misc]
    def test_connect(foo: int) -> None:

Your Environment

  • Mypy version used: 1.14.1
  • Mypy command-line flags: --disallow-any-decorated
  • Python version used: 3.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-disallow-anyThe disallow-any-* family of flags

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions