@@ -425,20 +425,29 @@ def test_assigned_stmts_type_var():
425425 assign_stmts = extract_node ("type Point[T] = tuple[float, float]" )
426426 type_var : nodes .TypeVar = assign_stmts .type_params [0 ]
427427 assigned = next (type_var .name .assigned_stmts ())
428- assert assigned is Uninferable
428+ # Hack so inference doesn't fail when evaluating __class_getitem__
429+ # Revert if it's causing issues.
430+ assert isinstance (assigned , nodes .Const )
431+ assert assigned .value is None
429432
430433 @staticmethod
431434 def test_assigned_stmts_type_var_tuple ():
432435 """The result is 'Uninferable' and no exception is raised."""
433436 assign_stmts = extract_node ("type Alias[*Ts] = tuple[*Ts]" )
434437 type_var_tuple : nodes .TypeVarTuple = assign_stmts .type_params [0 ]
435438 assigned = next (type_var_tuple .name .assigned_stmts ())
436- assert assigned is Uninferable
439+ # Hack so inference doesn't fail when evaluating __class_getitem__
440+ # Revert if it's causing issues.
441+ assert isinstance (assigned , nodes .Const )
442+ assert assigned .value is None
437443
438444 @staticmethod
439445 def test_assigned_stmts_param_spec ():
440446 """The result is 'Uninferable' and no exception is raised."""
441447 assign_stmts = extract_node ("type Alias[**P] = Callable[P, int]" )
442448 param_spec : nodes .ParamSpec = assign_stmts .type_params [0 ]
443449 assigned = next (param_spec .name .assigned_stmts ())
444- assert assigned is Uninferable
450+ # Hack so inference doesn't fail when evaluating __class_getitem__
451+ # Revert if it's causing issues.
452+ assert isinstance (assigned , nodes .Const )
453+ assert assigned .value is None
0 commit comments