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

(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:59:46 -08:00 committed by GitHub
parent 353674f289
commit 331378dffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4243,6 +4243,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, ...],