Fix patch.object to return a _patch context manager. (#1142)

* Fix patch.object to return a _patch context manager.

This should fix https://github.com/python/typeshed/issues/914

* Prefer None over ... to be consistent with the rest of the file.
This commit is contained in:
Roy Williams
2017-04-06 18:47:28 -07:00
committed by Matthias Kramm
parent 6e75432504
commit 452c1e1d78

View File

@@ -92,7 +92,11 @@ if sys.version_info >= (3, 3):
def start(self) -> Any: ...
def stop(self) -> Any: ...
def patch(target: Any, new: Any =..., spec: Any = None, create: Any = False, spec_set: Any = None, autospec: Any = None, new_callable: Any = None, **kwargs: Any) -> Any: ...
class _patcher:
def __call__(self, target: Any, new: Any = None, spec: Any = None, create: Any = False, spec_set: Any = None, autospec: Any = None, new_callable: Any = None, **kwargs: Any) -> Any: ...
def object(self, target: Any, attribute: str, new: Any = None, spec: Any = None, create: Any = False, spec_set: Any = None, autospec: Any = None, new_callable: Any = None, **kwargs: Any) -> _patch: ...
patch = ... # type: _patcher
class _patch_dict:
in_dict = ... # type: Any