Skip to content

Commit

Permalink
pythongh-128613: Increase typing.Concatenate coverage (python#128614)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Jan 8, 2025
1 parent 971a52b commit eb26e17
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10129,6 +10129,18 @@ def test_valid_uses(self):
self.assertEqual(C4.__args__, (Concatenate[int, T, P], T))
self.assertEqual(C4.__parameters__, (T, P))

def test_invalid_uses(self):
with self.assertRaisesRegex(TypeError, 'Concatenate of no types'):
Concatenate[()]
with self.assertRaisesRegex(
TypeError,
(
'The last parameter to Concatenate should be a '
'ParamSpec variable or ellipsis'
),
):
Concatenate[int]

def test_var_substitution(self):
T = TypeVar('T')
P = ParamSpec('P')
Expand Down

0 comments on commit eb26e17

Please sign in to comment.