From: Nikita Sobolev Date: Tue, 1 Feb 2022 09:58:41 +0000 (+0300) Subject: bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821) X-Git-Tag: v3.11.0a5~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c0612ad00ba45dbea2a86f7db6d21546cf243f8;p=thirdparty%2FPython%2Fcpython.git bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821) --- diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 8449affd03a7..090d4c70d3d8 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -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]),