Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2370,12 +2370,12 @@ Sealing mocks

.. function:: seal(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.
Seal will disable the creation of mock children by preventing getting or setting
of any new attribute on the sealed mock. The sealing process is performed recursively.

If a mock instance is assigned to an attribute instead of being dynamically created
it won't be considered in the sealing chain. This allows to prevent seal from fixing
part of the mock object.
it won't be considered in the sealing chain. This allows one to prevent seal from
fixing part of the mock object.

>>> mock = Mock()
>>> mock.submock.attribute1 = 2
Expand Down