@@ -1274,9 +1274,7 @@ def test_dt64arr_series_sub_tick_DateOffset(self, box_with_array):
1274
1274
1275
1275
result2 = - pd .offsets .Second (5 ) + ser
1276
1276
tm .assert_equal (result2 , expected )
1277
- msg = (
1278
- "TypeError: unsupported operand type(s) for -: 'DatetimeArray' and 'Second'"
1279
- )
1277
+ msg = "Unsupported operand type(s) for -: 'DatetimeArray' and 'Second'"
1280
1278
with pytest .raises (TypeError , match = re .escape (msg )):
1281
1279
pd .offsets .Second (5 ) - ser
1282
1280
@@ -1322,7 +1320,7 @@ def test_dti_add_tick_tzaware(self, tz_aware_fixture, box_with_array):
1322
1320
tm .assert_equal (roundtrip , dates )
1323
1321
1324
1322
msg = (
1325
- r"TypeError: unsupported operand type\(s\) "
1323
+ r"Unsupported operand type\(s\) "
1326
1324
"for -: 'DatetimeArray' and '.*'|"
1327
1325
r"cannot subtract DatetimeArray from .*"
1328
1326
)
@@ -1384,10 +1382,7 @@ def test_dt64arr_add_sub_relativedelta_offsets(self, box_with_array, unit):
1384
1382
expected = DatetimeIndex ([x - off for x in vec_items ]).as_unit (exp_unit )
1385
1383
expected = tm .box_expected (expected , box_with_array )
1386
1384
tm .assert_equal (expected , vec - off )
1387
- msg = (
1388
- r"TypeError: unsupported operand type\(s\) "
1389
- "for -: 'DatetimeArray' and '.*'"
1390
- )
1385
+ msg = r"Unsupported operand type\(s\) " "for -: 'DatetimeArray' and '.*'"
1391
1386
with pytest .raises (TypeError , match = msg ):
1392
1387
off - vec
1393
1388
@@ -1503,9 +1498,7 @@ def test_dt64arr_add_sub_DateOffsets(
1503
1498
expected = DatetimeIndex ([offset + x for x in vec_items ]).as_unit (unit )
1504
1499
expected = tm .box_expected (expected , box_with_array )
1505
1500
tm .assert_equal (expected , offset + vec )
1506
- msg = (
1507
- r"TypeError: unsupported operand type\(s\) for -: 'DatetimeArray' and '.*'"
1508
- )
1501
+ msg = r"Unsupported operand type\(s\) for -: 'DatetimeArray' and '.*'"
1509
1502
with pytest .raises (TypeError , match = msg ):
1510
1503
offset - vec
1511
1504
@@ -1994,10 +1987,7 @@ def test_operators_datetimelike_with_timezones(self):
1994
1987
result = dt1 - td1 [0 ]
1995
1988
exp = (dt1 .dt .tz_localize (None ) - td1 [0 ]).dt .tz_localize (tz )
1996
1989
tm .assert_series_equal (result , exp )
1997
- msg = (
1998
- r"TypeError: unsupported operand type\(s\) "
1999
- "for -: 'DatetimeArray' and 'Timedelta'"
2000
- )
1990
+ msg = r"Unsupported operand type\(s\) " "for -: 'DatetimeArray' and 'Timedelta'"
2001
1991
with pytest .raises (TypeError , match = msg ):
2002
1992
td1 [0 ] - dt1
2003
1993
0 commit comments