From 6e13e50859087044efb74f60f74495d31ee51ee2 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 11 Feb 2024 10:14:37 +0100 Subject: [PATCH] [3.12] gh-115274: Fix direct invocation of `testmock/testpatch.py` (GH-115275) (#115280) gh-115274: Fix direct invocation of `testmock/testpatch.py` (GH-115275) (cherry picked from commit f8e9c57067e32baab4ed2fd824b892c52ecb7225) Co-authored-by: Nikita Sobolev --- Lib/test/test_unittest/testmock/testpatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_unittest/testmock/testpatch.py b/Lib/test/test_unittest/testmock/testpatch.py index 833d7da1f31a20..d0046d702a53f4 100644 --- a/Lib/test/test_unittest/testmock/testpatch.py +++ b/Lib/test/test_unittest/testmock/testpatch.py @@ -1912,7 +1912,7 @@ def foo(x=0): with patch.object(foo, '__module__', "testpatch2"): self.assertEqual(foo.__module__, "testpatch2") - self.assertEqual(foo.__module__, 'test.test_unittest.testmock.testpatch') + self.assertEqual(foo.__module__, __name__) with patch.object(foo, '__annotations__', dict([('s', 1, )])): self.assertEqual(foo.__annotations__, dict([('s', 1, )]))