From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 1 Feb 2022 10:27:36 +0000 (-0800) Subject: bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821) X-Git-Tag: v3.10.3~145 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a188d88c562bfd68ef3a32d148d9b234d50646e;p=thirdparty%2FPython%2Fcpython.git bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821) (cherry picked from commit 4c0612ad00ba45dbea2a86f7db6d21546cf243f8) Co-authored-by: Nikita Sobolev --- diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index e5b596e7f3d8..366f7d8eb31d 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -4543,6 +4543,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]),