]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-137716: Fix double period in AttributeError message for invalid mock assertions...
authorROHAN WINSOR <61073765+rohanwinsor@users.noreply.github.com>
Thu, 14 Aug 2025 21:26:02 +0000 (02:56 +0530)
committerGitHub <noreply@github.com>
Thu, 14 Aug 2025 21:26:02 +0000 (21:26 +0000)
Lib/unittest/mock.py
Misc/NEWS.d/next/Core_and_Builtins/2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst [new file with mode: 0644]

index e1dbfdacf56337336f82eb462b090112650a0569..0bb6750655380de6b27745bc372ff109628ab52e 100644 (file)
@@ -700,7 +700,7 @@ class NonCallableMock(Base):
             if name.startswith(('assert', 'assret', 'asert', 'aseert', 'assrt')) or name in _ATTRIB_DENY_LIST:
                 raise AttributeError(
                     f"{name!r} is not a valid assertion. Use a spec "
-                    f"for the mock if {name!r} is meant to be an attribute.")
+                    f"for the mock if {name!r} is meant to be an attribute")
 
         with NonCallableMock._lock:
             result = self._mock_children.get(name)
diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst
new file mode 100644 (file)
index 0000000..82d8e15
--- /dev/null
@@ -0,0 +1 @@
+Fix double period in :exc:`AttributeError` message for invalid mock assertions