mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
bpo-30541: Add new method to seal mocks (GH61923)
The new method allows the developer to control when to stop the feature of mocks that automagically creates new mocks when accessing an attribute that was not declared before Signed-off-by: Mario Corchero <mariocj89@gmail.com>
This commit is contained in:
parent
2bd37c227e
commit
552be9d7e6
5 changed files with 249 additions and 2 deletions
|
@ -304,6 +304,11 @@ The :const:`~unittest.mock.sentinel` attributes now preserve their identity
|
|||
when they are :mod:`copied <copy>` or :mod:`pickled <pickle>`. (Contributed by
|
||||
Serhiy Storchaka in :issue:`20804`.)
|
||||
|
||||
New function :const:`~unittest.mock.seal` will disable the creation of mock
|
||||
children by preventing to get or set any new attribute on the sealed mock.
|
||||
The sealing process is performed recursively. (Contributed by Mario Corchero
|
||||
in :issue:`30541`.)
|
||||
|
||||
xmlrpc.server
|
||||
-------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue