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

[0.24.0 regression] @overloads of responses.activate need to be restored too #692

Closed
andersk opened this issue Nov 13, 2023 · 0 comments · Fixed by #694
Closed

[0.24.0 regression] @overloads of responses.activate need to be restored too #692

andersk opened this issue Nov 13, 2023 · 0 comments · Fixed by #694
Assignees
Labels

Comments

@andersk
Copy link

andersk commented Nov 13, 2023

Describe the bug

#684 incorrectly removed the @overload declarations for CallList.__getitem__ and responses.activate. The former was restored in #690, but the latter needs to be restored too, as shown by the example below.

Additional context

No response

Version of responses

0.24.0

Steps to Reproduce

Run mypy on this code:

import responses


class C:
    @responses.activate
    def f(self) -> str:
        return "hello"

    def g(self) -> None:
        greeting: str = self.f()

Expected Result

Success: no issues found in 1 source file

Actual Result

test.py:10: error: Too few arguments  [call-arg]
test.py:10: error: Incompatible types in assignment (expression has type "Callable[..., Any] | Any", variable has type "str")  [assignment]
Found 2 errors in 1 file (checked 1 source file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants