def test_dti_add_offset_array(self, tz):
    dti = pd.date_range('2017-01-01', periods=2, tz=tz)
    other = np.array([pd.offsets.MonthEnd(), pd.offsets.Day(n=2)])
    with tm.assert_produces_warning(PerformanceWarning):
        res = (dti + other)
    expected = DatetimeIndex([(dti[n] + other[n]) for n in range(len(dti))], name=dti.name, freq='infer')
    tm.assert_index_equal(res, expected)
    with tm.assert_produces_warning(PerformanceWarning):
        res2 = (other + dti)
    tm.assert_index_equal(res2, expected)
def test_dti_add_offset_array(self, tz):
    dti = pd.date_range('2017-01-01', periods=2, tz=tz)
    other = np.array([pd.offsets.MonthEnd(), pd.offsets.Day(n=2)])
    with tm.assert_produces_warning(PerformanceWarning):
        res = (dti + other)
    expected = DatetimeIndex([(dti[n] + other[n]) for n in range(len(dti))], name=dti.name, freq='infer')
    tm.assert_index_equal(res, expected)
    with tm.assert_produces_warning(PerformanceWarning):
        res2 = (other + dti)
    tm.assert_index_equal(res2, expected)