From 144c95276e448f16c04d147d7d23a48cfc8e147f Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 19 Jan 2022 17:13:38 +0300 Subject: [PATCH] [3.10] bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641) Use `__name__` (cherry picked from commit 2792d6d18eab3efeb71e6397f88db86e610541f1) Co-authored-by: Nikita Sobolev --- Lib/test/test_typing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index ee432b65cf5df5..4d001120ab7765 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -4982,7 +4982,7 @@ def test_special_attrs2(self): ) self.assertEqual( SpecialAttrsTests.TypeName.__module__, - 'test.test_typing', + __name__, ) # NewTypes are picklable assuming correct qualname information. for proto in range(pickle.HIGHEST_PROTOCOL + 1): @@ -4996,7 +4996,7 @@ def test_special_attrs2(self): # __qualname__ is unnecessary. self.assertEqual(SpecialAttrsT.__name__, 'SpecialAttrsT') self.assertFalse(hasattr(SpecialAttrsT, '__qualname__')) - self.assertEqual(SpecialAttrsT.__module__, 'test.test_typing') + self.assertEqual(SpecialAttrsT.__module__, __name__) # Module-level type variables are picklable. for proto in range(pickle.HIGHEST_PROTOCOL + 1): s = pickle.dumps(SpecialAttrsT, proto) @@ -5005,7 +5005,7 @@ def test_special_attrs2(self): self.assertEqual(SpecialAttrsP.__name__, 'SpecialAttrsP') self.assertFalse(hasattr(SpecialAttrsP, '__qualname__')) - self.assertEqual(SpecialAttrsP.__module__, 'test.test_typing') + self.assertEqual(SpecialAttrsP.__module__, __name__) # Module-level ParamSpecs are picklable. for proto in range(pickle.HIGHEST_PROTOCOL + 1): s = pickle.dumps(SpecialAttrsP, proto)