[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 f8e9c57067)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2024-02-11 10:14:37 +01:00 committed by GitHub
parent 5baf90e038
commit 6e13e50859
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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, )]))