Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JMMarchant opened this issue Jan 12, 2022 · 5 comments · Fixed by #469
Closed

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

JMMarchant opened this issue Jan 12, 2022 · 5 comments · Fixed by #469
Assignees
Labels

Comments

@JMMarchant
Copy link

JMMarchant commented Jan 12, 2022

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.

@beliaev-maksim
Copy link
Collaborator

@JMMarchant
can you please check it on https://github.com/beliaev-maksim/responses/tree/fix_468 and confirm that the issue is gone

@JMMarchant
Copy link
Author

Yep, that looks to have fixed it!

@beliaev-maksim
Copy link
Collaborator

@JMMarchant
thanks for confirmation!

@beliaev-maksim
Copy link
Collaborator

@markstory
any idea why disallow_untyped_decorators did not raise on our side?

any test we can add to prevent this in the future?

@markstory
Copy link
Member

any idea why disallow_untyped_decorators did not raise on our side?

It looks like that check has been disabled in this project's mypy.ini. I can work on merging our stubs with the implementation and removing some of the disabled warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants