Skip to content

Commit 660ddd8

Browse files
dpgeorgeprojectgus
authored andcommitted
datetime: Change "US/Eastern" to "America/New_York" in unit tests.
The "US/Eastern" timezone name has been deprecated for a while now and is no longer included in recent Ubuntu 26.04 by default. Use the canonical "America/New_York" instead, which looks to be widely available (on Ubuntu and Arch Linux at least). See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for a list of timezone names and their canonical status. Signed-off-by: Damien George <damien@micropython.org>
1 parent 00f72c4 commit 660ddd8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎python-stdlib/datetime/test_datetime.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,15 +1645,15 @@ def test_fromtimestamp05(self):
16451645
self.assertTrue(ds.fold)
16461646

16471647
def test_fromtimestamp06(self):
1648-
with LocalTz("US/Eastern"):
1648+
with LocalTz("America/New_York"):
16491649
dt = datetime(2020, 11, 1, 5, 30, tzinfo=timezone.utc)
16501650
ts = (dt - EPOCH).total_seconds()
16511651
dt = dt.replace(tzinfo=None) - 4 * td1h
16521652
ds = datetime.fromtimestamp(ts)
16531653
self.assertEqual(ds, dt)
16541654

16551655
def test_fromtimestamp07(self):
1656-
with LocalTz("US/Eastern"):
1656+
with LocalTz("America/New_York"):
16571657
dt = datetime(2020, 11, 1, 7, 30, tzinfo=timezone.utc)
16581658
ts = (dt - EPOCH).total_seconds()
16591659
dt = dt.replace(tzinfo=None) - 5 * td1h
@@ -2110,22 +2110,22 @@ def test_timestamp05(self):
21102110
self.assertEqual(dt.timestamp(), 1288488600.0)
21112111

21122112
def test_timestamp06(self):
2113-
with LocalTz("US/Eastern"):
2113+
with LocalTz("America/New_York"):
21142114
dt = datetime(2020, 3, 8, 2, 30) # doesn't exist
21152115
self.assertEqual(dt.timestamp(), 1583652600.0)
21162116

21172117
def test_timestamp07(self):
2118-
with LocalTz("US/Eastern"):
2118+
with LocalTz("America/New_York"):
21192119
dt = datetime(2020, 8, 10, 2, 30)
21202120
self.assertEqual(dt.timestamp(), 1597041000.0)
21212121

21222122
def test_timestamp08(self):
2123-
with LocalTz("US/Eastern"):
2123+
with LocalTz("America/New_York"):
21242124
dt = datetime(2020, 11, 1, 2, 30, fold=0)
21252125
self.assertEqual(dt.timestamp(), 1604215800.0)
21262126

21272127
def test_timestamp09(self):
2128-
with LocalTz("US/Eastern"):
2128+
with LocalTz("America/New_York"):
21292129
dt = datetime(2020, 11, 1, 2, 30, fold=1)
21302130
self.assertEqual(dt.timestamp(), 1604215800.0)
21312131

0 commit comments

Comments
 (0)