Skip to content

Commit 6578726

Browse files
author
Paulo Henrique Silva
committed
bpo-37955: mock.patch incorrect reference to Mock
mock.patch mentions that keyword arguments are passed to Mock when it passes to MagicMock by default. This PR fixes that.
1 parent b3b9619 commit 6578726

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/library/unittest.mock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ patch
13691369
"as"; very useful if :func:`patch` is creating a mock object for you.
13701370

13711371
:func:`patch` takes arbitrary keyword arguments. These will be passed to
1372-
the :class:`Mock` (or *new_callable*) on construction.
1372+
the :class:`MagicMock` (or *new_callable*) on construction.
13731373

13741374
``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are
13751375
available for alternate use-cases.

Lib/unittest/mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ def patch(
16511651
"as"; very useful if `patch` is creating a mock object for you.
16521652
16531653
`patch` takes arbitrary keyword arguments. These will be passed to
1654-
the `Mock` (or `new_callable`) on construction.
1654+
the `MagicMock` (or `new_callable`) on construction.
16551655
16561656
`patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are
16571657
available for alternate use-cases.

0 commit comments

Comments
 (0)