mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-128613: Increase typing.Concatenate
coverage (#128614)
This commit is contained in:
parent
971a52b549
commit
eb26e17069
1 changed files with 12 additions and 0 deletions
|
@ -10129,6 +10129,18 @@ class ConcatenateTests(BaseTestCase):
|
|||
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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue