Skip to content

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

@andersk

Description

@andersk

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)

Metadata

Metadata

Labels

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions