Skip to content

Commit

Permalink
bpo-46424: [typing] cover Annotation[arg] invalid usage in tests (G…
Browse files Browse the repository at this point in the history
…H-30663)

(cherry picked from commit 3239829)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
miss-islington and sobolevn committed Jan 19, 2022
1 parent 24d0b33 commit baf26d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/test_typing.py
Expand Up @@ -4512,6 +4512,10 @@ def test_cannot_check_subclass(self):
with self.assertRaises(TypeError):
issubclass(int, Annotated[int, "positive"])

def test_too_few_type_args(self):
with self.assertRaisesRegex(TypeError, 'at least two arguments'):
Annotated[int]

def test_pickle(self):
samples = [typing.Any, typing.Union[int, str],
typing.Optional[str], Tuple[int, ...],
Expand Down

0 comments on commit baf26d0

Please sign in to comment.