]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-115274: Fix direct invocation of testmock/testpatch.py (GH-115275) (#115281)
authorNikita Sobolev <mail@sobolevn.me>
Sun, 11 Feb 2024 09:14:25 +0000 (12:14 +0300)
committerGitHub <noreply@github.com>
Sun, 11 Feb 2024 09:14:25 +0000 (12:14 +0300)
(cherry picked from commit f8e9c57067e32baab4ed2fd824b892c52ecb7225)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Lib/unittest/test/testmock/testpatch.py

index cda286bb74d6aef81fe0967daaffad68e848f7f2..3a1c4f74a40dc326070ae516094be03af5a640f7 100644 (file)
@@ -1912,7 +1912,7 @@ class PatchTest(unittest.TestCase):
 
         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, )]))