Skip to content

Commit

Permalink
[3.10] bpo-46416: Allow direct invocation of Lib/test/test_typing.py (
Browse files Browse the repository at this point in the history
GH-30641) (GH-30697)

Use `__name__`
(cherry picked from commit 2792d6d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
sobolevn committed Jan 24, 2022
1 parent b2c7fe1 commit eaeb994
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/test/test_typing.py
Expand Up @@ -5067,7 +5067,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):
Expand All @@ -5081,7 +5081,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)
Expand All @@ -5090,7 +5090,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)
Expand Down

0 comments on commit eaeb994

Please sign in to comment.