@@ -1164,21 +1164,6 @@ def any(self, axis=None):
1164
1164
1165
1165
1166
1166
class TestCanHoldElement :
1167
- #############################
1168
-
1169
- # THINGS TO SOLVE BEFORE MERGING THIS PULL REQUEST:
1170
-
1171
- # Delete this comment :)
1172
-
1173
- # Should "ops" be called "_ops" instead ?
1174
-
1175
- # What to do about the comment that was in the "else" block?
1176
- # """
1177
- # FIXME: Since dispatching to Series, this test no longer
1178
- # asserts anything meaningful
1179
- # """
1180
-
1181
- #############################
1182
1167
1183
1168
ops = pytest .mark .parametrize (
1184
1169
"op" ,
@@ -1265,7 +1250,16 @@ def test_binop_m(self, op, value):
1265
1250
s = pd .DataFrame ({"A" : [e .value , e .value ]}, dtype = e .dtype )
1266
1251
1267
1252
if op in [operator .mul , operator .pow ]:
1268
- with pytest .raises (TypeError ):
1253
+ # operator.mul will raise an external error message.
1254
+ msg = (
1255
+ None
1256
+ if op == operator .mul
1257
+ else (
1258
+ f"cannot perform __{ op .__name__ } __ "
1259
+ "with this index type: TimedeltaArray"
1260
+ )
1261
+ )
1262
+ with pytest .raises (TypeError , match = msg ):
1269
1263
op (s , e .value )
1270
1264
else :
1271
1265
result = op (s , e .value ).dtypes
@@ -1287,7 +1281,16 @@ def test_binop_m_capitalized(self, op, value):
1287
1281
operator .pow ,
1288
1282
operator .truediv ,
1289
1283
]:
1290
- with pytest .raises (TypeError ):
1284
+ # operator.add will raise an external error message.
1285
+ msg = (
1286
+ None
1287
+ if op == operator .add
1288
+ else (
1289
+ f"cannot perform __{ op .__name__ } __ "
1290
+ "with this index type: DatetimeArray"
1291
+ )
1292
+ )
1293
+ with pytest .raises (TypeError , match = msg ):
1291
1294
op (s , e .value )
1292
1295
else :
1293
1296
result = op (s , e .value ).dtypes
0 commit comments