https://github.com/python/cpython/commit/77b411bd90b154ad84158515f0b346b647379ae2 commit: 77b411bd90b154ad84158515f0b346b647379ae2 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: AlexWaygood <[email protected]> date: 2025-01-08T12:26:01Z summary:
[3.13] gh-128613: Increase `typing.Concatenate` coverage (GH-128614) (#128623) 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 f32bb31280a8ef..cf0406faf11670 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -9998,6 +9998,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]
