@@ -267,9 +267,15 @@ def test_tick_rdiv(cls):
267
267
delta = off .delta
268
268
td64 = delta .to_timedelta64 ()
269
269
270
- with pytest .raises (TypeError ):
270
+ msg = (
271
+ "unsupported operand type\\ (s\\ ) for \\ /: 'int'|'float' and "
272
+ f"'{ '.' .join ([cls .__module__ , cls .__name__ ])} '"
273
+ )
274
+
275
+ with pytest .raises (TypeError , match = msg ):
271
276
2 / off
272
- with pytest .raises (TypeError ):
277
+
278
+ with pytest .raises (TypeError , match = msg ):
273
279
2.0 / off
274
280
275
281
assert (td64 * 2.5 ) / off == 2.5
@@ -331,13 +337,18 @@ def test_compare_ticks_to_strs(cls):
331
337
assert not "foo" == off
332
338
333
339
for left , right in [("infer" , off ), (off , "infer" )]:
334
- with pytest .raises (TypeError ):
340
+ instance_type = "." .join ([cls .__module__ , cls .__name__ ])
341
+ msg = (
342
+ "'<'|'<='|'>'|'>=' not supported between instances of "
343
+ f"'str' and '{ instance_type } '|'{ instance_type } ' and 'str'"
344
+ )
345
+ with pytest .raises (TypeError , match = msg ):
335
346
left < right
336
- with pytest .raises (TypeError ):
347
+ with pytest .raises (TypeError , match = msg ):
337
348
left <= right
338
- with pytest .raises (TypeError ):
349
+ with pytest .raises (TypeError , match = msg ):
339
350
left > right
340
- with pytest .raises (TypeError ):
351
+ with pytest .raises (TypeError , match = msg ):
341
352
left >= right
342
353
343
354
0 commit comments