bpo-46424: [typing] cover Annotation[arg] invalid usage in tests (GH-30663)

(cherry picked from commit 32398294fb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2022-01-19 07:54:07 -08:00 committed by GitHub
parent 24d0b331e8
commit baf26d07a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4512,6 +4512,10 @@ class AnnotatedTests(BaseTestCase):
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, ...],