summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_typing.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 0bb9ada..a75dac4 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -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')