diff options
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r-- | Lib/unittest/mock.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 1e8057d5f5..47ed06c6f4 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -572,7 +572,8 @@ class NonCallableMock(Base): raise AttributeError(name) if not self._mock_unsafe: if name.startswith(('assert', 'assret')): - raise AttributeError(name) + raise AttributeError("Attributes cannot start with 'assert' " + "or 'assret'") result = self._mock_children.get(name) if result is _deleted: |