From d45035bb21ff51edd3b8568958ec16f3918e4490 Mon Sep 17 00:00:00 2001 From: rohanwinsor Date: Wed, 13 Aug 2025 22:14:31 +0530 Subject: [PATCH 1/3] Fix formatting of error message in __getattr__ method --- Lib/unittest/mock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index e1dbfdacf56337..0bb6750655380d 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -700,7 +700,7 @@ def __getattr__(self, name): 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) From 9fb559145819110b1b6319d347ccf006a1edc07f Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 16:58:59 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst 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 index 00000000000000..60edd929ce9391 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst @@ -0,0 +1 @@ +Fix double period in AttributeError message for invalid mock assertions From 7614c55f936b432568a72ab5af6984a94f45349d Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 14 Aug 2025 14:00:38 -0700 Subject: [PATCH 3/3] Update Misc/NEWS.d/next/Core_and_Builtins/2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst --- .../2025-08-13-16-58-58.gh-issue-137716.ZcZSyi.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 60edd929ce9391..82d8e1577905a7 100644 --- 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 @@ -1 +1 @@ -Fix double period in AttributeError message for invalid mock assertions +Fix double period in :exc:`AttributeError` message for invalid mock assertions