From 6a188d88c562bfd68ef3a32d148d9b234d50646e Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 1 Feb 2022 02:27:36 -0800 Subject: bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821) (cherry picked from commit 4c0612ad00ba45dbea2a86f7db6d21546cf243f8) Co-authored-by: Nikita Sobolev --- Lib/test/test_typing.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index e5b596e..366f7d8 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]), -- cgit v0.12