Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 3 Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,8 @@ patch
"as"; very useful if :func:`patch` is creating a mock object for you.

:func:`patch` takes arbitrary keyword arguments. These will be passed to
the :class:`Mock` (or *new_callable*) on construction.
:class:`AsyncMock` if the patched object is asynchronous, to
:class:`MagicMock` otherwise or to *new_callable* if specified.

``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are
available for alternate use-cases.
Expand Down
3 changes: 2 additions & 1 deletion 3 Lib/unittest/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,8 @@ def patch(
"as"; very useful if `patch` is creating a mock object for you.

`patch` takes arbitrary keyword arguments. These will be passed to
the `Mock` (or `new_callable`) on construction.
`AsyncMock` if the patched object is asynchronous, to `MagicMock`
otherwise or to `new_callable` if specified.

`patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are
available for alternate use-cases.
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.