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

Skip to content

Commit 6a188d8

Browse files
bpo-46482: add a test for typing.Annotation.__new__ (GH-30821)
(cherry picked from commit 4c0612a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parent 3479451 commit 6a188d8

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

45444544
class AnnotatedTests(BaseTestCase):
45454545

4546+
def test_new(self):
4547+
with self.assertRaisesRegex(
4548+
TypeError,
4549+
'Type Annotated cannot be instantiated',
4550+
):
4551+
Annotated()
4552+
45464553
def test_repr(self):
45474554
self.assertEqual(
45484555
repr(Annotated[int, 4, 5]),

0 commit comments

Comments
 (0)
0