diff options
author | Jack DeVries <58614260+jdevries3133@users.noreply.github.com> | 2021-07-05 02:52:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 07:52:32 +0100 |
commit | abb08e3af6aa19928007a349592e95e6de38467f (patch) | |
tree | cc64ac66bee7a42538c6ead08c7705a3250c59b2 | |
parent | a9a69bb3ea1e6cf54513717212aaeae0d61b24ee (diff) | |
download | cpython-git-abb08e3af6aa19928007a349592e95e6de38467f.tar.gz |
bpo-44534: fix wording and docstring sync in unittest.Mock GH27000
-rw-r--r-- | Doc/library/unittest.mock.rst | 2 | ||||
-rw-r--r-- | Lib/unittest/mock.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index f1c0757c51..e760321ba1 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -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. diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index a4e571a805..5be91203ec 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -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 |