]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821)
authorNikita Sobolev <mail@sobolevn.me>
Tue, 1 Feb 2022 09:58:41 +0000 (12:58 +0300)
committerGitHub <noreply@github.com>
Tue, 1 Feb 2022 09:58:41 +0000 (17:58 +0800)
Lib/test/test_typing.py

index 8449affd03a768acc642ceedeab0756d2c526dde..090d4c70d3d8492a72047cfb07f237de4537e185 100644 (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]),