@pytest.mark.parametrize('years', [(- 1), 0, 1])
@pytest.mark.parametrize('months', [(- 2), 0, 2])
def test_shift_months(years, months):
    s = DatetimeIndex([Timestamp('2000-01-05 00:15:00'), Timestamp('2000-01-31 00:23:00'), Timestamp('2000-01-01'), Timestamp('2000-02-29'), Timestamp('2000-12-31')])
    actual = DatetimeIndex(shift_months(s.asi8, ((years * 12) + months)))
    raw = [(x + pd.offsets.DateOffset(years=years, months=months)) for x in s]
    expected = DatetimeIndex(raw)
    tm.assert_index_equal(actual, expected)
@pytest.mark.parametrize('years', [(- 1), 0, 1])
@pytest.mark.parametrize('months', [(- 2), 0, 2])
def test_shift_months(years, months):
    s = DatetimeIndex([Timestamp('2000-01-05 00:15:00'), Timestamp('2000-01-31 00:23:00'), Timestamp('2000-01-01'), Timestamp('2000-02-29'), Timestamp('2000-12-31')])
    actual = DatetimeIndex(shift_months(s.asi8, ((years * 12) + months)))
    raw = [(x + pd.offsets.DateOffset(years=years, months=months)) for x in s]
    expected = DatetimeIndex(raw)
    tm.assert_index_equal(actual, expected)