From 6480dcbe8ab159f5aecfd87091cb48ce59de832e Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 11 Feb 2024 11:51:25 +0300 Subject: [PATCH] [3.11] gh-115274: Fix direct invocation of testmock/testpatch.py (GH-115275) --- Lib/unittest/test/testmock/testpatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/unittest/test/testmock/testpatch.py index cda286bb74d6ae..3a1c4f74a40dc3 100644 --- a/Lib/unittest/test/testmock/testpatch.py +++ b/Lib/unittest/test/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__, 'unittest.test.testmock.testpatch') + self.assertEqual(foo.__module__, __name__) with patch.object(foo, '__annotations__', dict([('s', 1, )])): self.assertEqual(foo.__annotations__, dict([('s', 1, )]))