[Python-checkins] bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641)

Fidget-Spinner webhook-mailer at python.org
Wed Jan 19 09:13:49 EST 2022


https://github.com/python/cpython/commit/2792d6d18eab3efeb71e6397f88db86e610541f1
commit: 2792d6d18eab3efeb71e6397f88db86e610541f1
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: Fidget-Spinner <28750310+Fidget-Spinner at users.noreply.github.com>
date: 2022-01-19T22:13:38+08:00
summary:

bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641)

Use `__name__`

files:
M Lib/test/test_typing.py

diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 97c2c7f56cecb..e61f8828f5405 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -5071,7 +5071,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):
@@ -5085,7 +5085,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)
@@ -5094,7 +5094,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)



More information about the Python-checkins mailing list