bpo-46482: add a test for typing.Annotation.__new__ (GH-30821)

This commit is contained in:
Nikita Sobolev 2022-02-01 12:58:41 +03:00 committed by GitHub
parent ee0ac328d3
commit 4c0612ad00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4643,6 +4643,13 @@ class RETests(BaseTestCase):
class AnnotatedTests(BaseTestCase):
def test_new(self):
with self.assertRaisesRegex(
TypeError,
'Type Annotated cannot be instantiated',
):
Annotated()
def test_repr(self):
self.assertEqual(
repr(Annotated[int, 4, 5]),