mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
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:
parent
24d0b331e8
commit
baf26d07a6
1 changed files with 4 additions and 0 deletions
|
@ -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, ...],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue