]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44534: fix wording and docstring sync in unittest.Mock GH27000
authorJack DeVries <58614260+jdevries3133@users.noreply.github.com>
Mon, 5 Jul 2021 06:52:32 +0000 (02:52 -0400)
committerGitHub <noreply@github.com>
Mon, 5 Jul 2021 06:52:32 +0000 (07:52 +0100)
Doc/library/unittest.mock.rst
Lib/unittest/mock.py

index f1c0757c510fa60cfef5ff68e9c7641d4825e548..e760321ba129c404c53314c2328e824e0585134e 100644 (file)
@@ -262,7 +262,7 @@ the *new_callable* argument to :func:`patch`.
       this is a new Mock (created on first access). See the
       :attr:`return_value` attribute.
 
-    * *unsafe*: By default, accessing any attribute with name starting with
+    * *unsafe*: By default, accessing any attribute whose name starts with
       *assert*, *assret*, *asert*, *aseert* or *assrt* will raise an
       :exc:`AttributeError`. Passing ``unsafe=True`` will allow access to
       these attributes.
index a4e571a80508eb3293ff9d1a7b7a13b98eeacd9c..5be91203ec7d7c8855a7c327d1d70c95625fd11d 100644 (file)
@@ -1215,6 +1215,11 @@ class Mock(CallableMixin, NonCallableMock):
       this is a new Mock (created on first access). See the
       `return_value` attribute.
 
+    * `unsafe`: By default, accessing any attribute whose name starts with
+      *assert*, *assret*, *asert*, *aseert* or *assrt* will raise an
+       AttributeError. Passing `unsafe=True` will allow access to
+      these attributes.
+
     * `wraps`: Item for the mock object to wrap. If `wraps` is not None then
       calling the Mock will pass the call through to the wrapped object
       (returning the real result). Attribute access on the mock will return a