8000 bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (G… · python/cpython@baf26d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit baf26d0

Browse files
bpo-46424: [typing] cover Annotation[arg] invalid usage in tests (GH-30663)
(cherry picked from commit 3239829) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parent 24d0b33 commit baf26d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_typing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,6 +4512,10 @@ def test_cannot_check_subclass(self):
45124512
with self.assertRaises(TypeError):
45134513
issubclass(int, Annotated[int, "positive"])
45144514

4515+
def test_too_few_type_args(self):
4516+
with self.assertRaisesRegex(TypeError, 'at least two arguments'):
4517+
Annotated[int]
4518+
45154519
def test_pickle(self):
45164520
samples = [typing.Any, typing.Union[int, str],
45174521
typing.Optional[str], Tuple[int, ...],

0 commit comments

Comments
 (0)
0