Skip to content

Commit 56e978c

Browse files
committed
gh-144849: Unit test fails if ran with Europe/Dublin locale
1 parent 5fe139c commit 56e978c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/test_time.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,15 @@ def test_localtime_timezone(self):
803803
if lt.tm_gmtoff is None:
804804
self.assertNotHasAttr(time, "timezone")
805805
else:
806-
self.assertEqual(lt.tm_gmtoff, -[time.timezone, time.altzone][lt.tm_isdst])
806+
# Ireland standard time is during the summer, so it's the opposite to everything else
807+
if time.tzname[lt.tm_isdst] != "IST":
808+
self.assertEqual(lt.tm_gmtoff, -[time.timezone, time.altzone][lt.tm_isdst])
807809
if lt.tm_zone is None:
808810
self.assertNotHasAttr(time, "tzname")
809811
else:
810-
self.assertEqual(lt.tm_zone, time.tzname[lt.tm_isdst])
812+
# IST = GMT but lt.tm_zone is GMT
813+
if time.tzname[lt.tm_isdst] != "IST":
814+
self.assertEqual(lt.tm_zone, time.tzname[lt.tm_isdst])
811815

812816
# Try and make UNIX times from the localtime and a 9-tuple
813817
# created from the localtime. Test to see that the times are

0 commit comments

Comments
 (0)