Skip to content

Commit abb08e3

Browse files
authored
bpo-44534: fix wording and docstring sync in unittest.Mock GH27000
1 parent a9a69bb commit abb08e3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Doc/library/unittest.mock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ the *new_callable* argument to :func:`patch`.
262262
this is a new Mock (created on first access). See the
263263
:attr:`return_value` attribute.
264264

265-
* *unsafe*: By default, accessing any attribute with name starting with
265+
* *unsafe*: By default, accessing any attribute whose name starts with
266266
*assert*, *assret*, *asert*, *aseert* or *assrt* will raise an
267267
:exc:`AttributeError`. Passing ``unsafe=True`` will allow access to
268268
these attributes.

Lib/unittest/mock.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,11 @@ class or instance) that acts as the specification for the mock object. If
12151215
this is a new Mock (created on first access). See the
12161216
`return_value` attribute.
12171217
1218+
* `unsafe`: By default, accessing any attribute whose name starts with
1219+
*assert*, *assret*, *asert*, *aseert* or *assrt* will raise an
1220+
AttributeError. Passing `unsafe=True` will allow access to
1221+
these attributes.
1222+
12181223
* `wraps`: Item for the mock object to wrap. If `wraps` is not None then
12191224
calling the Mock will pass the call through to the wrapped object
12201225
(returning the real result). Attribute access on the mock will return a

0 commit comments

Comments
 (0)