@@ -452,8 +452,18 @@ async def coroutine[B]():
452452
453453class TypeParamsTypeVarTupleTest (unittest .TestCase ):
454454 def test_typevartuple_01 (self ):
455- code = """def func1[*A: str](): return (A, B, C)"""
456- check_syntax_error (self , code , r"expected '\('" )
455+ code = """def func1[*A: str](): pass"""
456+ check_syntax_error (self , code , "cannot use bound with TypeVarTuple" )
457+ code = """def func1[*A: (int, str)](): pass"""
458+ check_syntax_error (self , code , "cannot use constraints with TypeVarTuple" )
459+ code = """class X[*A: str]: pass"""
460+ check_syntax_error (self , code , "cannot use bound with TypeVarTuple" )
461+ code = """class X[*A: (int, str)]: pass"""
462+ check_syntax_error (self , code , "cannot use constraints with TypeVarTuple" )
463+ code = """type X[*A: str] = int"""
464+ check_syntax_error (self , code , "cannot use bound with TypeVarTuple" )
465+ code = """type X[*A: (int, str)] = int"""
466+ check_syntax_error (self , code , "cannot use constraints with TypeVarTuple" )
457467
458468 def test_typevartuple_02 (self ):
459469 def func1 [* A ]():
@@ -465,8 +475,18 @@ def func1[*A]():
465475
466476class TypeParamsTypeVarParamSpec (unittest .TestCase ):
467477 def test_paramspec_01 (self ):
468- code = """def func1[**A: str](): return (A, B, C)"""
469- check_syntax_error (self , code , r"expected '\('" )
478+ code = """def func1[**A: str](): pass"""
479+ check_syntax_error (self , code , "cannot use bound with ParamSpec" )
480+ code = """def func1[**A: (int, str)](): pass"""
481+ check_syntax_error (self , code , "cannot use constraints with ParamSpec" )
482+ code = """class X[**A: str]: pass"""
483+ check_syntax_error (self , code , "cannot use bound with ParamSpec" )
484+ code = """class X[**A: (int, str)]: pass"""
485+ check_syntax_error (self , code , "cannot use constraints with ParamSpec" )
486+ code = """type X[**A: str] = int"""
487+ check_syntax_error (self , code , "cannot use bound with ParamSpec" )
488+ code = """type X[**A: (int, str)] = int"""
489+ check_syntax_error (self , code , "cannot use constraints with ParamSpec" )
470490
471491 def test_paramspec_02 (self ):
472492 def func1 [** A ]():
0 commit comments