Skip to content

@responses.activate triggers untyped decorator error in mypy #468

@JMMarchant

Description

@JMMarchant

Environment

responses==0.17.0
mypy==0.931
Python 3.8.12

disallow_untyped_decorators = True in mypy.ini

Steps to Reproduce

After upgrade to responses==0.17.0, reran mypy with settings unchanged from before.

Expected Result

mypy passes as happened with responses==0.16.0

Actual Result

Every instance of @responses.activate throws up:

error: Untyped decorator makes function "<function_name>" untyped  [misc]
    @responses.activate

The issue seems to be related to the change here where the type hint for activate was changed from a callback protocol to Any.

Metadata

Metadata

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions