|
26 | 26 | Timestamp,
|
27 | 27 | date_range,
|
28 | 28 | )
|
29 |
| -import pandas.core.arrays.datetimelike as dtl |
30 | 29 | from pandas.core.indexes.datetimes import _to_M8
|
31 | 30 | from pandas.core.ops import roperator
|
32 | 31 | from pandas.tests.arithmetic.common import (
|
@@ -1332,7 +1331,7 @@ def test_dt64arr_add_mixed_offset_array(self, box_with_array):
|
1332 | 1331 | s = tm.box_expected(s, box_with_array)
|
1333 | 1332 |
|
1334 | 1333 | warn = None if box_with_array is pd.DataFrame else PerformanceWarning
|
1335 |
| - with tm.assert_produces_warning(warn, clear=[dtl]): |
| 1334 | + with tm.assert_produces_warning(warn): |
1336 | 1335 | other = pd.Index([pd.offsets.DateOffset(years=1), pd.offsets.MonthEnd()])
|
1337 | 1336 | other = tm.box_expected(other, box_with_array)
|
1338 | 1337 | result = s + other
|
@@ -1361,19 +1360,19 @@ def test_dt64arr_add_sub_offset_ndarray(self, tz_naive_fixture, box_with_array):
|
1361 | 1360 | other = np.array([pd.offsets.MonthEnd(), pd.offsets.Day(n=2)])
|
1362 | 1361 |
|
1363 | 1362 | warn = None if box_with_array is pd.DataFrame else PerformanceWarning
|
1364 |
| - with tm.assert_produces_warning(warn, clear=[dtl]): |
| 1363 | + with tm.assert_produces_warning(warn): |
1365 | 1364 | res = dtarr + other
|
1366 | 1365 | expected = DatetimeIndex(
|
1367 | 1366 | [dti[n] + other[n] for n in range(len(dti))], name=dti.name, freq="infer"
|
1368 | 1367 | )
|
1369 | 1368 | expected = tm.box_expected(expected, box_with_array)
|
1370 | 1369 | tm.assert_equal(res, expected)
|
1371 | 1370 |
|
1372 |
| - with tm.assert_produces_warning(warn, clear=[dtl]): |
| 1371 | + with tm.assert_produces_warning(warn): |
1373 | 1372 | res2 = other + dtarr
|
1374 | 1373 | tm.assert_equal(res2, expected)
|
1375 | 1374 |
|
1376 |
| - with tm.assert_produces_warning(warn, clear=[dtl]): |
| 1375 | + with tm.assert_produces_warning(warn): |
1377 | 1376 | res = dtarr - other
|
1378 | 1377 | expected = DatetimeIndex(
|
1379 | 1378 | [dti[n] - other[n] for n in range(len(dti))], name=dti.name, freq="infer"
|
@@ -2298,7 +2297,7 @@ def test_dti_addsub_offset_arraylike(
|
2298 | 2297 |
|
2299 | 2298 | xbox = get_upcast_box(box, other)
|
2300 | 2299 |
|
2301 |
| - with tm.assert_produces_warning(PerformanceWarning, clear=[dtl]): |
| 2300 | + with tm.assert_produces_warning(PerformanceWarning): |
2302 | 2301 | res = op(dti, other)
|
2303 | 2302 |
|
2304 | 2303 | expected = DatetimeIndex(
|
|
0 commit comments