@@ -425,20 +425,29 @@ def test_assigned_stmts_type_var():
425
425
assign_stmts = extract_node ("type Point[T] = tuple[float, float]" )
426
426
type_var : nodes .TypeVar = assign_stmts .type_params [0 ]
427
427
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
429
432
430
433
@staticmethod
431
434
def test_assigned_stmts_type_var_tuple ():
432
435
"""The result is 'Uninferable' and no exception is raised."""
433
436
assign_stmts = extract_node ("type Alias[*Ts] = tuple[*Ts]" )
434
437
type_var_tuple : nodes .TypeVarTuple = assign_stmts .type_params [0 ]
435
438
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
437
443
438
444
@staticmethod
439
445
def test_assigned_stmts_param_spec ():
440
446
"""The result is 'Uninferable' and no exception is raised."""
441
447
assign_stmts = extract_node ("type Alias[**P] = Callable[P, int]" )
442
448
param_spec : nodes .ParamSpec = assign_stmts .type_params [0 ]
443
449
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