Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmylow committed Nov 24, 2023
1 parent 8d0a264 commit 50386d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pandas/tests/indexes/datetimes/test_date_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,21 @@ def test_date_range_negative_freq_year_end(self, unit):
tm.assert_index_equal(rng, exp)
assert rng.freq == "-2YE"

def test_date_range_negative_freq_year_end_inbounds(self, unit):
# GH#56147
rng = date_range(
start = "2023-10-31 00:00:00",
end = "2021-10-31 00:00:00",
freq="-1YE",
unit=unit,
)
exp = DatetimeIndex(
["2022-12-31 00:00:00", "2021-12-31 00:00:00"],
dtype=f"M8[{unit}]",
freq="-1YE",
)
tm.assert_index_equal(rng, exp)

def test_date_range_business_year_end_year(self, unit):
# see GH#9313
rng = date_range("1/1/2013", "7/1/2017", freq="BYE", unit=unit)
Expand Down

0 comments on commit 50386d8

Please sign in to comment.