Skip to content
Prev Previous commit
Next Next commit
fixed
  • Loading branch information
bilaljai committed Dec 11, 2022
commit 4dfa6b3dd3f77b98e33a91c77d0374b827fc9bc5
18 changes: 13 additions & 5 deletions pandas/tests/tseries/holiday/test_holiday.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,21 @@ def test_holidays_within_dates(holiday, start, expected):
holiday.dates(utc.localize(Timestamp(start)), utc.localize(Timestamp(start)))
) == [utc.localize(dt) for dt in expected]


def test_holidays_outside_dates():
hol = Holiday("Dec 25", month=12, day=25, observance=next_monday, days_of_week=(5, 6),
end_date=Timestamp("2013-01-01"))
hol = Holiday(
"Dec 25",
month=12,
day=25,
observance=next_monday,
days_of_week=(5, 6),
end_date=Timestamp("2013-01-01"),
)
expected = hol.dates(Timestamp("2010-01-01"), Timestamp("2023-01-01"))
assert(isinstance(hol.dates(Timestamp("2020-01-01"), Timestamp("2023-01-01")), type(expected)))

assert isinstance(
hol.dates(Timestamp("2020-01-01"), Timestamp("2023-01-01")), type(expected)
)


@pytest.mark.parametrize(
"transform", [lambda x: x.strftime("%Y-%m-%d"), lambda x: Timestamp(x)]
Expand Down