diff --git a/stdlib/3/unittest/mock.pyi b/stdlib/3/unittest/mock.pyi index 0c34f72ddbc0..0acbb68753cc 100644 --- a/stdlib/3/unittest/mock.pyi +++ b/stdlib/3/unittest/mock.pyi @@ -4,6 +4,7 @@ from typing import Any, Callable, Generic, List, Mapping, Optional, Sequence, Te _F = TypeVar("_F", bound=Callable[..., Any]) _T = TypeVar("_T") _TT = TypeVar("_TT", bound=Type[Any]) +_R = TypeVar("_R") __all__ = [ "Mock", @@ -193,7 +194,7 @@ class _patch(Generic[_T]): kwargs: Mapping[str, Any], ) -> None: ... def copy(self) -> _patch[_T]: ... - def __call__(self, func: _F) -> _F: ... + def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... def decorate_class(self, klass: _TT) -> _TT: ... def decorate_callable(self, func: _F) -> _F: ... def get_original(self) -> Tuple[Any, bool]: ... diff --git a/third_party/2and3/mock.pyi b/third_party/2and3/mock.pyi index 0c34f72ddbc0..0acbb68753cc 100644 --- a/third_party/2and3/mock.pyi +++ b/third_party/2and3/mock.pyi @@ -4,6 +4,7 @@ from typing import Any, Callable, Generic, List, Mapping, Optional, Sequence, Te _F = TypeVar("_F", bound=Callable[..., Any]) _T = TypeVar("_T") _TT = TypeVar("_TT", bound=Type[Any]) +_R = TypeVar("_R") __all__ = [ "Mock", @@ -193,7 +194,7 @@ class _patch(Generic[_T]): kwargs: Mapping[str, Any], ) -> None: ... def copy(self) -> _patch[_T]: ... - def __call__(self, func: _F) -> _F: ... + def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... def decorate_class(self, klass: _TT) -> _TT: ... def decorate_callable(self, func: _F) -> _F: ... def get_original(self) -> Tuple[Any, bool]: ...