From: Nikita Sobolev Date: Tue, 18 Jan 2022 14:43:51 +0000 (+0300) Subject: bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663) X-Git-Tag: v3.11.0a5~221 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32398294fb3fcf4ee74da54722fd0221c4e6cb74;p=thirdparty%2FPython%2Fcpython.git bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663) --- diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index c8a077e2f1ff..97c2c7f56cec 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -4609,6 +4609,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, ...],