mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
[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:
parent
353674f289
commit
331378dffc
1 changed files with 4 additions and 0 deletions
|
|
@ -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, ...],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue