mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-37955: correct mock.patch docs with respect to the returned type (GH-15521)
This commit is contained in:
parent
62865f4532
commit
40c080934b
2 changed files with 4 additions and 2 deletions
|
@ -1401,7 +1401,8 @@ patch
|
||||||
"as"; very useful if :func:`patch` is creating a mock object for you.
|
"as"; very useful if :func:`patch` is creating a mock object for you.
|
||||||
|
|
||||||
:func:`patch` takes arbitrary keyword arguments. These will be passed to
|
: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
|
``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are
|
||||||
available for alternate use-cases.
|
available for alternate use-cases.
|
||||||
|
|
|
@ -1730,7 +1730,8 @@ def patch(
|
||||||
"as"; very useful if `patch` is creating a mock object for you.
|
"as"; very useful if `patch` is creating a mock object for you.
|
||||||
|
|
||||||
`patch` takes arbitrary keyword arguments. These will be passed to
|
`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
|
`patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are
|
||||||
available for alternate use-cases.
|
available for alternate use-cases.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue