8000 bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821) · python/cpython@4c0612a · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c0612a

Browse files
authored
bpo-46482: add a test for typing.Annotation.__new__ (GH-30821)
1 parent ee0ac32 commit 4c0612a

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
@@ -4643,6 +4643,13 @@ class A(typing.Match):
46434643

46444644
class AnnotatedTests(BaseTestCase):
46454645

4646+
def test_new(self):
4647+
with self.assertRaisesRegex(
4648+
TypeError,
4649+
'Type Annotated cannot be instantiated',
4650+
):
4651+
Annotated()
4652+
46464653
def test_repr(self):
46474654
self.assertEqual(
46484655
repr(Annotated[int, 4, 5]),

0 commit comments

Comments
 (0)
0