Skip to content

Commit 331378d

Browse files
[3.9] bpo-46424: [typing] cover Annotation[arg] invalid usage in tests (GH-30663) (GH-30692)
(cherry picked from commit 3239829) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parent 353674f commit 331378d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_typing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4243,6 +4243,10 @@ def test_cannot_check_subclass(self):
42434243
with self.assertRaises(TypeError):
42444244
issubclass(int, Annotated[int, "positive"])
42454245

4246+
def test_too_few_type_args(self):
4247+
with self.assertRaisesRegex(TypeError, 'at least two arguments'):
4248+
Annotated[int]
4249+
42464250
def test_pickle(self):
42474251
samples = [typing.Any, typing.Union[int, str],
42484252
typing.Optional[str], Tuple[int, ...],

0 commit comments

Comments
 (0)