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
1 changed files with 7 additions and 0 deletions

View File

@ -4643,6 +4643,13 @@ class A(typing.Match):
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]),