mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Fix mock patch.dict stub and add mock stub (#2173)
The dict stub was referring to an instance, not the type, leading to __call__ being considered when using as a decorator, rather than __init__. mock is a backport of the stdlib module and should be defined the same.
This commit is contained in:
committed by
Jelle Zijlstra
parent
a3031adb46
commit
98badb6eff
@@ -1,7 +1,7 @@
|
||||
# Stubs for unittest.mock
|
||||
|
||||
import sys
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Optional, Type
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
FILTER_DIR = ... # type: Any
|
||||
@@ -111,7 +111,7 @@ if sys.version_info >= (3, 3):
|
||||
|
||||
class _patcher:
|
||||
TEST_PREFIX = ... # type: str
|
||||
dict = ... # type: _patch_dict
|
||||
dict = ... # type: Type[_patch_dict]
|
||||
def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
def object(self, target: Any, attribute: str, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ...
|
||||
def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user