mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Add a more precise signature for AsyncMock.reset_mock() (#10481)
This commit is contained in:
@@ -389,7 +389,11 @@ if sys.version_info >= (3, 8):
|
||||
class AsyncMagicMixin(MagicMixin):
|
||||
def __init__(self, *args: Any, **kw: Any) -> None: ...
|
||||
|
||||
class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ...
|
||||
class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock):
|
||||
# Improving the `reset_mock` signature.
|
||||
# It is defined on `AsyncMockMixin` with `*args, **kwargs`, which is not ideal.
|
||||
# But, `NonCallableMock` super-class has the better version.
|
||||
def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ...
|
||||
|
||||
class MagicProxy:
|
||||
name: str
|
||||
|
||||
@@ -329,7 +329,12 @@ class AsyncMockMixin(Base):
|
||||
__annotations__: dict[str, Any] | None # type: ignore[assignment]
|
||||
|
||||
class AsyncMagicMixin(MagicMixin): ...
|
||||
class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ...
|
||||
|
||||
class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock):
|
||||
# Improving the `reset_mock` signature.
|
||||
# It is defined on `AsyncMockMixin` with `*args, **kwargs`, which is not ideal.
|
||||
# But, `NonCallableMock` super-class has the better version.
|
||||
def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ...
|
||||
|
||||
class MagicProxy(Base):
|
||||
name: str
|
||||
|
||||
Reference in New Issue
Block a user