@@ -944,7 +944,7 @@ def _get_expected_exception(
944
944
self , op_name : str , obj , other
945
945
) -> type [Exception ] | None :
946
946
if op_name in ("__divmod__" , "__rdivmod__" ):
947
- return self .divmod_exc
947
+ return ( self .divmod_exc , TypeError )
948
948
949
949
dtype = tm .get_dtype (obj )
950
950
# error: Item "dtype[Any]" of "dtype[Any] | ExtensionDtype" has no
@@ -956,7 +956,7 @@ def _get_expected_exception(
956
956
"__mod__" ,
957
957
"__rmod__" ,
958
958
}:
959
- exc = NotImplementedError
959
+ exc = ( NotImplementedError , TypeError )
960
960
elif arrow_temporal_supported :
961
961
exc = None
962
962
elif op_name in ["__add__" , "__radd__" ] and (
@@ -971,7 +971,7 @@ def _get_expected_exception(
971
971
# TODO: in many of these cases, e.g. non-duration temporal,
972
972
# these will *never* be allowed. Would it make more sense to
973
973
# re-raise as TypeError, more consistent with non-pyarrow cases?
974
- exc = pa .ArrowNotImplementedError
974
+ exc = ( pa .ArrowNotImplementedError , TypeError )
975
975
else :
976
976
exc = None
977
977
return exc
@@ -1027,14 +1027,6 @@ def test_arith_series_with_scalar(self, data, all_arithmetic_operators, request)
1027
1027
1028
1028
if all_arithmetic_operators == "__rmod__" and pa .types .is_binary (pa_dtype ):
1029
1029
pytest .skip ("Skip testing Python string formatting" )
1030
- elif all_arithmetic_operators in ("__rmul__" , "__mul__" ) and (
1031
- pa .types .is_binary (pa_dtype ) or pa .types .is_string (pa_dtype )
1032
- ):
1033
- request .applymarker (
1034
- pytest .mark .xfail (
1035
- raises = TypeError , reason = "Can only string multiply by an integer."
1036
- )
1037
- )
1038
1030
1039
1031
mark = self ._get_arith_xfail_marker (all_arithmetic_operators , pa_dtype )
1040
1032
if mark is not None :
@@ -1049,14 +1041,6 @@ def test_arith_frame_with_scalar(self, data, all_arithmetic_operators, request):
1049
1041
pa .types .is_string (pa_dtype ) or pa .types .is_binary (pa_dtype )
1050
1042
):
1051
1043
pytest .skip ("Skip testing Python string formatting" )
1052
- elif all_arithmetic_operators in ("__rmul__" , "__mul__" ) and (
1053
- pa .types .is_binary (pa_dtype ) or pa .types .is_string (pa_dtype )
1054
- ):
1055
- request .applymarker (
1056
- pytest .mark .xfail (
1057
- raises = TypeError , reason = "Can only string multiply by an integer."
1058
- )
1059
- )
1060
1044
1061
1045
mark = self ._get_arith_xfail_marker (all_arithmetic_operators , pa_dtype )
1062
1046
if mark is not None :
0 commit comments