@@ -156,8 +156,12 @@ def test_type_check_nested6():
156
156
157
157
158
158
def test_type_check_nested7 ():
159
+ TypeParser (ty .Tuple [float , float , float ])(lz (ty .List [int ]))
160
+
161
+
162
+ def test_type_check_nested7a ():
159
163
with pytest .raises (TypeError , match = "Wrong number of type arguments" ):
160
- TypeParser (ty .Tuple [float , float , float ])(lz (ty .List [int ]))
164
+ TypeParser (ty .Tuple [float , float , float ])(lz (ty .Tuple [int ]))
161
165
162
166
163
167
def test_type_check_nested8 ():
@@ -506,14 +510,29 @@ def test_matches_type_tuple():
506
510
assert not TypeParser .matches_type (ty .Tuple [int ], ty .Tuple [int , int ])
507
511
508
512
509
- def test_matches_type_tuple_ellipsis ():
513
+ def test_matches_type_tuple_ellipsis1 ():
510
514
assert TypeParser .matches_type (ty .Tuple [int ], ty .Tuple [int , ...])
515
+
516
+
517
+ def test_matches_type_tuple_ellipsis2 ():
511
518
assert TypeParser .matches_type (ty .Tuple [int , int ], ty .Tuple [int , ...])
519
+
520
+
521
+ def test_matches_type_tuple_ellipsis3 ():
512
522
assert not TypeParser .matches_type (ty .Tuple [int , float ], ty .Tuple [int , ...])
523
+
524
+
525
+ def test_matches_type_tuple_ellipsis4 ():
513
526
assert not TypeParser .matches_type (ty .Tuple [int , ...], ty .Tuple [int ])
527
+
528
+
529
+ def test_matches_type_tuple_ellipsis5 ():
514
530
assert TypeParser .matches_type (
515
531
ty .Tuple [int ], ty .List [int ], coercible = [(tuple , list )]
516
532
)
533
+
534
+
535
+ def test_matches_type_tuple_ellipsis6 ():
517
536
assert TypeParser .matches_type (
518
537
ty .Tuple [int , ...], ty .List [int ], coercible = [(tuple , list )]
519
538
)
0 commit comments