Skip to content

Commit

Permalink
Avoid using legacy time zone names in tests
Browse files Browse the repository at this point in the history
This commit replaces legacy time zone names (US/Eastern and US/Central)
with their current identifiers (America/New_York and America/Chicago)
across all tests.

Recent Debian distributions no longer include legacy time zone names in
the default installation, as they are moved to the tzdata-legacy
package. As a result, tests relying on these legacy names fail without
the tzdata-legacy package installed.
  • Loading branch information
EdwardBetts authored and gerrymanoim committed Jul 24, 2024
1 parent 3683b0d commit 091117b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_calendar_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_is_date(one_min):
assert not f(T("2021-11-01 23:59:00.999999"))
assert not f(T("2021-11-02 12:00"))

tz = ZoneInfo("US/Eastern")
tz = ZoneInfo("America/New_York")
minutes = [
T("2021-11-02", tz=UTC),
T("2021-11-02", tz=tz),
Expand All @@ -72,7 +72,7 @@ def test_is_utc():

expected = T("2021-11-02 13:33", tz=UTC)
assert f(T("2021-11-02 13:33")) == expected
assert f(T("2021-11-02 09:33", tz=ZoneInfo("US/Eastern"))) == expected
assert f(T("2021-11-02 09:33", tz=ZoneInfo("America/New_York"))) == expected


@pytest.fixture
Expand Down Expand Up @@ -318,7 +318,7 @@ def test_parse_date(date_mult, param_name):


def test_parse_date_errors(calendar, param_name, date_too_early, date_too_late):
dt = pd.Timestamp("2021-06-02", tz=ZoneInfo("US/Central"))
dt = pd.Timestamp("2021-06-02", tz=ZoneInfo("America/Chicago"))
with pytest.raises(ValueError, match="a Date must be timezone naive"):
m.parse_date(dt, param_name, raise_oob=False)

Expand Down

0 comments on commit 091117b

Please sign in to comment.