Fix patch() used as decorator (#4592)

Closes: #4591
This commit is contained in:
Sebastian Rittau
2020-10-02 09:05:25 +02:00
committed by GitHub
parent 8427e09424
commit 2157c4a448
2 changed files with 4 additions and 2 deletions

View File

@@ -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]: ...

View File

@@ -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]: ...