Skip to content

Commit 4618a09

Browse files
jbrockmendeljreback
authored andcommitted
catch PerformanceWarning (#19446)
1 parent e0d9651 commit 4618a09

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/tests/series/test_operators.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from pandas.core.indexes.timedeltas import Timedelta
2020
import pandas.core.nanops as nanops
2121

22+
from pandas.errors import PerformanceWarning
2223
from pandas.compat import range, zip
2324
from pandas import compat
2425
from pandas.util.testing import (assert_series_equal, assert_almost_equal,
@@ -871,8 +872,9 @@ def test_timedelta64_operations_with_DateOffset(self):
871872
expected = Series([timedelta(minutes=4, seconds=3)] * 3)
872873
assert_series_equal(result, expected)
873874

874-
result = td + Series([pd.offsets.Minute(1), pd.offsets.Second(3),
875-
pd.offsets.Hour(2)])
875+
with tm.assert_produces_warning(PerformanceWarning):
876+
result = td + Series([pd.offsets.Minute(1), pd.offsets.Second(3),
877+
pd.offsets.Hour(2)])
876878
expected = Series([timedelta(minutes=6, seconds=3), timedelta(
877879
minutes=5, seconds=6), timedelta(hours=2, minutes=5, seconds=3)])
878880
assert_series_equal(result, expected)

0 commit comments

Comments
 (0)