@@ -1039,28 +1039,19 @@ def test_type_is_instance11a():
1039
1039
assert not TypeParser .is_instance (None , int | str )
1040
1040
1041
1041
1042
- def test_multi_input_obj_coerce1 ():
1043
- assert TypeParser (MultiInputObj [str ])("a" ) == ["a" ]
1044
-
1045
-
1046
- def test_multi_input_obj_coerce2 ():
1047
- assert TypeParser (MultiInputObj [str ])(["a" ]) == ["a" ]
1048
-
1049
-
1050
- def test_multi_input_obj_coerce3 ():
1051
- assert TypeParser (MultiInputObj [ty .List [str ]])(["a" ]) == [["a" ]]
1052
-
1053
-
1054
- def test_multi_input_obj_coerce3a ():
1055
- assert TypeParser (MultiInputObj [ty .Union [int , ty .List [str ]]])(["a" ]) == [["a" ]]
1056
-
1057
-
1058
- def test_multi_input_obj_coerce3b ():
1059
- assert TypeParser (MultiInputObj [ty .Union [int , ty .List [str ]]])([["a" ]]) == [["a" ]]
1060
-
1061
-
1062
- def test_multi_input_obj_coerce4 ():
1063
- assert TypeParser (MultiInputObj [ty .Union [int , ty .List [str ]]])([1 ]) == [1 ]
1042
+ @pytest .mark .parametrize (
1043
+ ("typ" , "obj" , "result" ),
1044
+ [
1045
+ (MultiInputObj [str ], "a" , ["a" ]),
1046
+ (MultiInputObj [str ], ["a" ], ["a" ]),
1047
+ (MultiInputObj [ty .List [str ]], ["a" ], [["a" ]]),
1048
+ (MultiInputObj [ty .Union [int , ty .List [str ]]], ["a" ], [["a" ]]),
1049
+ (MultiInputObj [ty .Union [int , ty .List [str ]]], [["a" ]], [["a" ]]),
1050
+ (MultiInputObj [ty .Union [int , ty .List [str ]]], [1 ], [1 ]),
1051
+ ]
1052
+ )
1053
+ def test_multi_input_obj_coerce (typ , obj , result ):
1054
+ assert TypeParser (typ )(obj ) == result
1064
1055
1065
1056
1066
1057
def test_multi_input_obj_coerce4a ():
0 commit comments