Fix unittest.mock.patch class decorator annotation. (#6070)

This commit is contained in:
Matthew Suozzo
2021-09-29 03:27:47 -04:00
committed by GitHub
parent b99ddc1f2f
commit 9efd6521be

View File

@@ -1,7 +1,6 @@
import sys
from typing import Any, Callable, Generic, Iterable, List, Mapping, Sequence, Tuple, Type, TypeVar, overload
_F = TypeVar("_F", bound=Callable[..., Any])
_T = TypeVar("_T")
_TT = TypeVar("_TT", bound=Type[Any])
_R = TypeVar("_R")
@@ -176,9 +175,12 @@ class _patch(Generic[_T]):
kwargs: Mapping[str, Any],
) -> None: ...
def copy(self) -> _patch[_T]: ...
@overload
def __call__(self, func: _TT) -> _TT: ...
@overload
def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
def decorate_class(self, klass: _TT) -> _TT: ...
def decorate_callable(self, func: _F) -> _F: ...
def decorate_callable(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
def get_original(self) -> Tuple[Any, bool]: ...
target: Any
temp_original: Any