Skip to content

Commit 7fd85e9

Browse files
jbrockmendeljreback
authored andcommitted
CLN: remove warnings clearing (#30608)
1 parent 9f97d11 commit 7fd85e9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pandas/tests/arithmetic/test_datetime64.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
Timestamp,
2727
date_range,
2828
)
29-
import pandas.core.arrays.datetimelike as dtl
3029
from pandas.core.indexes.datetimes import _to_M8
3130
from pandas.core.ops import roperator
3231
from pandas.tests.arithmetic.common import (
@@ -1332,7 +1331,7 @@ def test_dt64arr_add_mixed_offset_array(self, box_with_array):
13321331
s = tm.box_expected(s, box_with_array)
13331332

13341333
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):
13361335
other = pd.Index([pd.offsets.DateOffset(years=1), pd.offsets.MonthEnd()])
13371336
other = tm.box_expected(other, box_with_array)
13381337
result = s + other
@@ -1361,19 +1360,19 @@ def test_dt64arr_add_sub_offset_ndarray(self, tz_naive_fixture, box_with_array):
13611360
other = np.array([pd.offsets.MonthEnd(), pd.offsets.Day(n=2)])
13621361

13631362
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):
13651364
res = dtarr + other
13661365
expected = DatetimeIndex(
13671366
[dti[n] + other[n] for n in range(len(dti))], name=dti.name, freq="infer"
13681367
)
13691368
expected = tm.box_expected(expected, box_with_array)
13701369
tm.assert_equal(res, expected)
13711370

1372-
with tm.assert_produces_warning(warn, clear=[dtl]):
1371+
with tm.assert_produces_warning(warn):
13731372
res2 = other + dtarr
13741373
tm.assert_equal(res2, expected)
13751374

1376-
with tm.assert_produces_warning(warn, clear=[dtl]):
1375+
with tm.assert_produces_warning(warn):
13771376
res = dtarr - other
13781377
expected = DatetimeIndex(
13791378
[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(
22982297

22992298
xbox = get_upcast_box(box, other)
23002299

2301-
with tm.assert_produces_warning(PerformanceWarning, clear=[dtl]):
2300+
with tm.assert_produces_warning(PerformanceWarning):
23022301
res = op(dti, other)
23032302

23042303
expected = DatetimeIndex(

0 commit comments

Comments
 (0)