From 5b26228c9a6535787c1351abf2f9c2ba65c0c118 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 18 Jan 2022 16:33:59 +0300 Subject: [PATCH] bpo-46424: cover `Annotation[int]` invalid usage in tests --- Lib/test/test_typing.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index c8a077e2f1ff55..97c2c7f56cecb2 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -4609,6 +4609,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, ...],