Skip to content

Commit 2532b7c

Browse files
[3.9] bpo-46482: add a test for typing.Annotation.__new__ (GH-30821) (GH-31045)
(cherry picked from commit 4c0612a) Co-authored-by: Nikita Sobolev <[email protected]> Automerge-Triggered-By: GH:Fidget-Spinner
1 parent 3046386 commit 2532b7c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_typing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4158,6 +4158,13 @@ class A(typing.Match):
41584158

41594159
class AnnotatedTests(BaseTestCase):
41604160

4161+
def test_new(self):
4162+
with self.assertRaisesRegex(
4163+
TypeError,
4164+
'Type Annotated cannot be instantiated',
4165+
):
4166+
Annotated()
4167+
41614168
def test_repr(self):
41624169
self.assertEqual(
41634170
repr(Annotated[int, 4, 5]),

0 commit comments

Comments
 (0)