Skip to content

Commit 3239829

Browse files
authored
bpo-46424: [typing] cover Annotation[arg] invalid usage in tests (GH-30663)
1 parent bdf2ab1 commit 3239829

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
@@ -4609,6 +4609,10 @@ def test_cannot_check_subclass(self):
46094609
with self.assertRaises(TypeError):
46104610
issubclass(int, Annotated[int, "positive"])
46114611

4612+
def test_too_few_type_args(self):
4613+
with self.assertRaisesRegex(TypeError, 'at least two arguments'):
4614+
Annotated[int]
4615+
46124616
def test_pickle(self):
46134617
samples = [typing.Any, typing.Union[int, str],
46144618
typing.Optional[str], Tuple[int, ...],

0 commit comments

Comments
 (0)