Skip to content

Commit

Permalink
bpo-44534: fix wording and docstring sync in unittest.Mock GH27000
Browse files Browse the repository at this point in the history
  • Loading branch information
jdevries3133 authored Jul 5, 2021
1 parent a9a69bb commit abb08e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions Lib/unittest/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,11 @@ class or instance) that acts as the specification for the mock object. If
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
Expand Down

0 comments on commit abb08e3

Please sign in to comment.