Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8665769

Browse files
authored
gh-137716: Fix double period in AttributeError message for invalid mock assertions (#137717)
1 parent 7812940 commit 8665769

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/unittest/mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ def __getattr__(self, name):
700700
if name.startswith(('assert', 'assret', 'asert', 'aseert', 'assrt')) or name in _ATTRIB_DENY_LIST:
701701
raise AttributeError(
702702
f"{name!r} is not a valid assertion. Use a spec "
703-
f"for the mock if {name!r} is meant to be an attribute.")
703+
f"for the mock if {name!r} is meant to be an attribute")
704704

705705
with NonCallableMock._lock:
706706
result = self._mock_children.get(name)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix double period in :exc:`AttributeError` message for invalid mock assertions

0 commit comments

Comments
 (0)