@@ -5782,7 +5782,7 @@ class D(Protocol[T1, T2, Unpack[Ts]]): pass
57825782 def test_substitution (self ):
57835783 Ts = TypeVarTuple ("Ts" )
57845784 unpacked_str = Unpack [Ts ][str ]
5785- with self .subTest ("Check full unpack " ):
5785+ with self .subTest ("Check substitution result " ):
57865786 self .assertIs (unpacked_str , str )
57875787
57885788 @skipUnless (TYPING_3_11_0 , "Needs Issue #103 first" )
@@ -5805,10 +5805,11 @@ def test_nested_unpack(self):
58055805 nested_tuple_A_unpack = TupleAliasTsT [Unpack [Tuple [str ]], object ]
58065806 self .assertEqual (nested_tuple_A , nested_tuple_A_unpack )
58075807
5808- with self .subTest ("With Callable Ts " ):
5808+ with self .subTest ("With Callable and Unpack " ):
58095809 # Tuple[int, (str, int) -> object]
58105810 CallableAliasTsT = Variadic [Callable [[Unpack [Ts ]], T ]]
5811- CallableAliasTsT [[str , int ], object ] # valid nested tuple
5811+ callable_fully_subscripted = CallableAliasTsT [Unpack [Tuple [str , int ]], object ]
5812+ self .assertEqual (get_args (callable_fully_subscripted ), (Callable [[str , int ], object ],))
58125813
58135814 # Equivalent Forms
58145815 with self .subTest ("Equivalence of variadic arguments" ):
@@ -5817,7 +5818,7 @@ def test_nested_unpack(self):
58175818 nested_tuple_B_2xUnpack = TupleAliasTsT [Unpack [Tuple [str ]], Unpack [Tuple [int ]], object ]
58185819 self .assertEqual (nested_tuple_B_1xUnpack , nested_tuple_bare )
58195820 self .assertEqual (nested_tuple_B_1xUnpack , nested_tuple_B_2xUnpack )
5820- self .assertNotEqual ( invalid_nested_tuple , nested_tuple_B_1xUnpack )
5821+ self .assertEqual ( get_args ( nested_tuple_B_2xUnpack ), ( Tuple [ str , int , object ], ) )
58215822
58225823
58235824class TypeVarTupleTests (BaseTestCase ):
0 commit comments