diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-01-18 14:43:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 14:43:51 (GMT) |
commit | 32398294fb3fcf4ee74da54722fd0221c4e6cb74 (patch) | |
tree | 8ebee7db51a1505d98269702af26d9d37e07598b | |
parent | bdf2ab1887a2edfb089a3c2a1590cf1e84ea0048 (diff) | |
download | cpython-32398294fb3fcf4ee74da54722fd0221c4e6cb74.zip cpython-32398294fb3fcf4ee74da54722fd0221c4e6cb74.tar.gz cpython-32398294fb3fcf4ee74da54722fd0221c4e6cb74.tar.bz2 |
bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663)
-rw-r--r-- | Lib/test/test_typing.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index c8a077e..97c2c7f 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, ...], |