Title: mock.patch incorrect reference to Mock
Type: Stage: resolved
Components: Documentation Versions: Python 3.9
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: cjw296, docs@python, phsilva
Priority: normal Keywords: patch

Created on 2019-08-26 15:11 by phsilva, last changed 2020-01-25 10:54 by cjw296. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15521 merged phsilva, 2019-08-26 15:24
Messages (2)
msg350537 - (view) Author: Paulo Henrique Silva (phsilva) * Date: 2019-08-26 15:11
When explaining the usage of keyword arguments on mock.patch:

patch() takes arbitrary keyword arguments. These will be passed to the Mock (or new_callable) on construction.

default new_callable is MagicMock and it should be mentioned here instead of Mock (even tough MagickMock inherits from it).
msg360680 - (view) Author: Chris Withers (cjw296) * (Python committer) Date: 2020-01-25 10:53
New changeset 40c080934b3d49311209b1cb690c2ea1e04df7e7 by Chris Withers (Paulo Henrique Silva) in branch 'master':
bpo-37955: correct mock.patch docs with respect to the returned type (GH-15521)
Date User Action Args
2020-01-25 10:54:09cjw296setstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-01-25 10:53:57cjw296setnosy: + cjw296
messages: + msg360680
2019-08-26 15:24:55phsilvasetkeywords: + patch
stage: patch review
pull_requests: + pull_request15204
2019-08-26 15:11:48phsilvacreate