https://github.com/python/cpython/commit/d8890fb82d07b47d181776c1f2ceff9ce4845e93
commit: d8890fb82d07b47d181776c1f2ceff9ce4845e93
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: sobolevn <[email protected]>
date: 2025-01-08T12:20:00Z
summary:

[3.12] gh-128613: Increase `typing.Concatenate` coverage (GH-128614) (#128624)

gh-128613: Increase `typing.Concatenate` coverage (GH-128614)
(cherry picked from commit eb26e170695f15714b5e2ae0c0b83aa790c97869)

Co-authored-by: sobolevn <[email protected]>

files:
M Lib/test/test_typing.py

diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 1da65162a0b300..c1057dc3887378 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -9315,6 +9315,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')

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to