@@ -30,13 +30,18 @@ def test_basic_type_var_tuple_subtype(self) -> None:
3030
3131 def test_basic_type_var_tuple (self ) -> None :
3232 fx = self .fx
33- assert infer_constraints (
34- Instance (fx .gvi , [UnpackType (fx .ts )]), Instance (fx .gvi , [fx .a , fx .b ]), SUPERTYPE_OF
35- ) == [
33+ assert set (
34+ infer_constraints (
35+ Instance (fx .gvi , [UnpackType (fx .ts )]), Instance (fx .gvi , [fx .a , fx .b ]), SUPERTYPE_OF
36+ )
37+ ) == {
3638 Constraint (
3739 type_var = fx .ts , op = SUPERTYPE_OF , target = TupleType ([fx .a , fx .b ], fx .std_tuple )
38- )
39- ]
40+ ),
41+ Constraint (
42+ type_var = fx .ts , op = SUBTYPE_OF , target = TupleType ([fx .a , fx .b ], fx .std_tuple )
43+ ),
44+ }
4045
4146 def test_type_var_tuple_with_prefix_and_suffix (self ) -> None :
4247 fx = self .fx
@@ -51,6 +56,9 @@ def test_type_var_tuple_with_prefix_and_suffix(self) -> None:
5156 Constraint (
5257 type_var = fx .ts , op = SUPERTYPE_OF , target = TupleType ([fx .b , fx .c ], fx .std_tuple )
5358 ),
59+ Constraint (
60+ type_var = fx .ts , op = SUBTYPE_OF , target = TupleType ([fx .b , fx .c ], fx .std_tuple )
61+ ),
5462 Constraint (type_var = fx .s , op = SUPERTYPE_OF , target = fx .d ),
5563 }
5664
@@ -64,7 +72,9 @@ def test_unpack_homogenous_tuple(self) -> None:
6472 )
6573 ) == {
6674 Constraint (type_var = fx .t , op = SUPERTYPE_OF , target = fx .a ),
75+ Constraint (type_var = fx .t , op = SUBTYPE_OF , target = fx .a ),
6776 Constraint (type_var = fx .t , op = SUPERTYPE_OF , target = fx .b ),
77+ Constraint (type_var = fx .t , op = SUBTYPE_OF , target = fx .b ),
6878 }
6979
7080 def test_unpack_homogenous_tuple_with_prefix_and_suffix (self ) -> None :
@@ -78,7 +88,9 @@ def test_unpack_homogenous_tuple_with_prefix_and_suffix(self) -> None:
7888 ) == {
7989 Constraint (type_var = fx .t , op = SUPERTYPE_OF , target = fx .a ),
8090 Constraint (type_var = fx .s , op = SUPERTYPE_OF , target = fx .b ),
91+ Constraint (type_var = fx .s , op = SUBTYPE_OF , target = fx .b ),
8192 Constraint (type_var = fx .s , op = SUPERTYPE_OF , target = fx .c ),
93+ Constraint (type_var = fx .s , op = SUBTYPE_OF , target = fx .c ),
8294 Constraint (type_var = fx .u , op = SUPERTYPE_OF , target = fx .d ),
8395 }
8496
@@ -93,7 +105,9 @@ def test_unpack_with_prefix_and_suffix(self) -> None:
93105 ) == {
94106 Constraint (type_var = fx .u , op = SUPERTYPE_OF , target = fx .a ),
95107 Constraint (type_var = fx .t , op = SUPERTYPE_OF , target = fx .b ),
108+ Constraint (type_var = fx .t , op = SUBTYPE_OF , target = fx .b ),
96109 Constraint (type_var = fx .s , op = SUPERTYPE_OF , target = fx .c ),
110+ Constraint (type_var = fx .s , op = SUBTYPE_OF , target = fx .c ),
97111 Constraint (type_var = fx .u , op = SUPERTYPE_OF , target = fx .d ),
98112 }
99113
0 commit comments