summaryrefslogtreecommitdiff
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r--Lib/unittest/mock.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 83026e6f3b..6b7f293bc5 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -2425,15 +2425,14 @@ class PropertyMock(Mock):
def seal(mock):
- """Disable the automatic generation of "submocks"
+ """Disable the automatic generation of child mocks.
Given an input Mock, seals it to ensure no further mocks will be generated
when accessing an attribute that was not already defined.
- Submocks are defined as all mocks which were created DIRECTLY from the
- parent. If a mock is assigned to an attribute of an existing mock,
- it is not considered a submock.
-
+ The operation recursively seals the mock passed in, meaning that
+ the mock itself, any mocks generated by accessing one of its attributes,
+ and all assigned mocks without a name or spec will be sealed.
"""
mock._mock_sealed = True
for attr in dir(mock):