Skip to content

Commit 8ae03df

Browse files
committed
TEST: Test Holiday.dates with tz-aware input.
1 parent 4cf60c9 commit 8ae03df

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/tseries/tests/test_holiday.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
HolidayCalendarFactory, next_workday, previous_workday,
1010
before_nearest_workday, EasterMonday, GoodFriday,
1111
after_nearest_workday, weekend_to_monday)
12+
from pytz import utc
1213
import nose
1314

1415
class TestCalendar(tm.TestCase):
@@ -56,9 +57,16 @@ def setUp(self):
5657
self.end_date = datetime(2020, 12, 31)
5758

5859
def check_results(self, holiday, start, end, expected):
60+
self.assertEqual(list(holiday.dates(start, end)), expected)
61+
# Verify that timezone info is preserved.
5962
self.assertEqual(
60-
list(holiday.dates(start, end)),
61-
expected,
63+
list(
64+
holiday.dates(
65+
utc.localize(Timestamp(start)),
66+
utc.localize(Timestamp(end)),
67+
)
68+
),
69+
[utc.localize(dt) for dt in expected],
6270
)
6371

6472
def test_usmemorialday(self):

0 commit comments

Comments
 (0)