@pytest.mark.parametrize('klass,assert_func', [(Series, tm.assert_series_equal), (DatetimeIndex, tm.assert_index_equal)])
def test_dt64_with_DateOffsets_relativedelta(klass, assert_func):
    vec = klass([Timestamp('2000-01-05 00:15:00'), Timestamp('2000-01-31 00:23:00'), Timestamp('2000-01-01'), Timestamp('2000-03-31'), Timestamp('2000-02-29'), Timestamp('2000-12-31'), Timestamp('2000-05-15'), Timestamp('2001-06-15')])
    relative_kwargs = [('years', 2), ('months', 5), ('days', 3), ('hours', 5), ('minutes', 10), ('seconds', 2), ('microseconds', 5)]
    for (i, kwd) in enumerate(relative_kwargs):
        op = pd.DateOffset(**dict([kwd]))
        assert_func(klass([(x + op) for x in vec]), (vec + op))
        assert_func(klass([(x - op) for x in vec]), (vec - op))
        op = pd.DateOffset(**dict(relative_kwargs[:(i + 1)]))
        assert_func(klass([(x + op) for x in vec]), (vec + op))
        assert_func(klass([(x - op) for x in vec]), (vec - op))
@pytest.mark.parametrize('klass,assert_func', [(Series, tm.assert_series_equal), (DatetimeIndex, tm.assert_index_equal)])
def test_dt64_with_DateOffsets_relativedelta(klass, assert_func):
    vec = klass([Timestamp('2000-01-05 00:15:00'), Timestamp('2000-01-31 00:23:00'), Timestamp('2000-01-01'), Timestamp('2000-03-31'), Timestamp('2000-02-29'), Timestamp('2000-12-31'), Timestamp('2000-05-15'), Timestamp('2001-06-15')])
    relative_kwargs = [('years', 2), ('months', 5), ('days', 3), ('hours', 5), ('minutes', 10), ('seconds', 2), ('microseconds', 5)]
    for (i, kwd) in enumerate(relative_kwargs):
        op = pd.DateOffset(**dict([kwd]))
        assert_func(klass([(x + op) for x in vec]), (vec + op))
        assert_func(klass([(x - op) for x in vec]), (vec - op))
        op = pd.DateOffset(**dict(relative_kwargs[:(i + 1)]))
        assert_func(klass([(x + op) for x in vec]), (vec + op))
        assert_func(klass([(x - op) for x in vec]), (vec - op))