Skip to content

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Oct 25, 2017

No description provided.

@@ -100,6 +100,7 @@ if sys.version_info >= (3, 3):
class _patcher:
def __call__(self, target: Any, new: Optional[Any] = None, spec: Optional[Any] = None, create: Any = False, spec_set: Optional[Any] = None, autospec: Optional[Any] = None, new_callable: Optional[Any] = None, **kwargs: Any) -> Any: ...
def object(self, target: Any, attribute: str, new: Optional[Any] = None, spec: Optional[Any] = None, create: Any = False, spec_set: Optional[Any] = None, autospec: Optional[Any] = None, new_callable: Optional[Any] = None, **kwargs: Any) -> _patch: ...
def multiple(self, target: Any, spec: Optional[Any] = None, create: Any = False, spec_set: Optional[Any] = None, autospec: Optional[Any] = None, new_callable: Optional[Any] = None, **kwargs: Any) -> Any: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All default values should be ... (even though the surrounding code doesn't follow that convention yet).

@srittau
Copy link
Collaborator Author

srittau commented Oct 25, 2017

I have updated the patch and added two more commits that change the arguments of patch() and patch.object() to the new style and tighten the type of the create argument, respectively.

@JelleZijlstra
Copy link
Member

Thanks, this looks good (relevant docs at https://docs.python.org/3/library/unittest.mock.html#patch-multiple). I'll merge once Travis is green.

@JelleZijlstra JelleZijlstra merged commit 87ef6b8 into python:master Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants