Inappropriateness in unittest documentation with actual behavior #118912
Copy link
Copy link
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Activity
Note that the doc describes the pre-Python 3.5 behavior. Since Python 3.5, one has to enable the
unsafeoption to achieve the same behavior:
cpython/Doc/library/unittest.mock.rst
Line 269 in c444362
:exc:`AttributeError`. Passing ``unsafe=True`` will allow access to 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.
Added in version 3.5.
I am working on this issue! I hope to finish it today (at the PyCon sprints)
Reacted by Hasan Aliyev and Hugo van Kemenade- added a commit that references this issue
on May 20, 2024
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
- StatusShow more project fieldsDone
Documentation
https://docs.python.org/3/library/unittest.mock.html#auto-speccing
cpython/Doc/library/unittest.mock.rst
Line 2615 in c444362
Expected that tests will pass as written in doc.
But actually script fails with raising error.
Am i missing something? I have tested this in Python3.11 and Python 3.12.
Looks like documentation must be updated or script must work as said in documenation.
Thanks for attention
Linked PRs