(holiday, start_date, end_date, expected)
| 125 | ], |
| 126 | ) |
| 127 | def test_holiday_dates(holiday, start_date, end_date, expected): |
| 128 | assert list(holiday.dates(start_date, end_date)) == expected |
| 129 | |
| 130 | # Verify that timezone info is preserved. |
| 131 | assert list( |
| 132 | holiday.dates( |
| 133 | Timestamp(start_date, tz=timezone.utc), Timestamp(end_date, tz=timezone.utc) |
| 134 | ) |
| 135 | ) == [dt.replace(tzinfo=timezone.utc) for dt in expected] |
| 136 | |
| 137 | |
| 138 | @pytest.mark.parametrize( |