Skip to content

Commit

Permalink
Fix patch() used as decorator (#4592)
Browse files Browse the repository at this point in the history
Closes: #4591
  • Loading branch information
srittau authored Oct 2, 2020
1 parent 8427e09 commit 2157c4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion stdlib/3/unittest/mock.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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]: ...
Expand Down
3 changes: 2 additions & 1 deletion third_party/2and3/mock.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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]: ...
Expand Down

0 comments on commit 2157c4a

Please sign in to comment.