diff options
author | Paulo Henrique Silva <ph.silva@gmail.com> | 2020-01-25 10:53:54 (GMT) |
---|---|---|
committer | Chris Withers <chris@withers.org> | 2020-01-25 10:53:54 (GMT) |
commit | 40c080934b3d49311209b1cb690c2ea1e04df7e7 (patch) | |
tree | 57229d44d35b10601bdfa87cc725122041a27da5 /Lib | |
parent | 62865f4532094017a9b780b704686ca9734bc329 (diff) | |
download | cpython-40c080934b3d49311209b1cb690c2ea1e04df7e7.zip cpython-40c080934b3d49311209b1cb690c2ea1e04df7e7.tar.gz cpython-40c080934b3d49311209b1cb690c2ea1e04df7e7.tar.bz2 |
bpo-37955: correct mock.patch docs with respect to the returned type (GH-15521)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/unittest/mock.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 047ae7c..a97542a 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1730,7 +1730,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. |