gh-95987: Fix repr of Any type subclasses (#96412)

This commit is contained in:
Nikita Sobolev 2022-08-30 20:36:16 +03:00 committed by GitHub
parent 6d791a9736
commit 4217393aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -113,6 +113,12 @@ class AnyTests(BaseTestCase):
def test_repr(self):
self.assertEqual(repr(Any), 'typing.Any')
class Sub(Any): pass
self.assertEqual(
repr(Sub),
"<class 'test.test_typing.AnyTests.test_repr.<locals>.Sub'>",
)
def test_errors(self):
with self.assertRaises(TypeError):
issubclass(42, Any)