@pytest.mark.parametrize('names', [(None, None, None), ('foo', 'bar', None), ('foo', 'foo', 'foo')])
def test_dti_sub_offset_index(self, tz, names):
    dti = pd.date_range('2017-01-01', periods=2, tz=tz, name=names[0])
    other = pd.Index([pd.offsets.MonthEnd(), pd.offsets.Day(n=2)], name=names[1])
    with tm.assert_produces_warning(PerformanceWarning):
        res = (dti - other)
    expected = DatetimeIndex([(dti[n] - other[n]) for n in range(len(dti))], name=names[2], freq='infer')
    tm.assert_index_equal(res, expected)
@pytest.mark.parametrize('names', [(None, None, None), ('foo', 'bar', None), ('foo', 'foo', 'foo')])
def test_dti_sub_offset_index(self, tz, names):
    dti = pd.date_range('2017-01-01', periods=2, tz=tz, name=names[0])
    other = pd.Index([pd.offsets.MonthEnd(), pd.offsets.Day(n=2)], name=names[1])
    with tm.assert_produces_warning(PerformanceWarning):
        res = (dti - other)
    expected = DatetimeIndex([(dti[n] - other[n]) for n in range(len(dti))], name=names[2], freq='infer')
    tm.assert_index_equal(res, expected)