diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-24 20:56:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 20:56:02 (GMT) |
commit | 652d3f33fb7c9f8cf5fe20bb27230afac8a0d5aa (patch) | |
tree | 0e1c77a6adbb507d313afe3c8f6e9e000d1ea287 | |
parent | ff7dc61643ce1640befdff451b4a05e0eae02c31 (diff) | |
download | cpython-652d3f33fb7c9f8cf5fe20bb27230afac8a0d5aa.zip cpython-652d3f33fb7c9f8cf5fe20bb27230afac8a0d5aa.tar.gz cpython-652d3f33fb7c9f8cf5fe20bb27230afac8a0d5aa.tar.bz2 |
[3.11] gh-109017: Use non alternate name for Kyiv (GH-109251) (GH-111279)
tzdata provides Kiev as an alternative to Kyiv:
https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314GH-L314
But Debian moved it to the tzdata-legacy package breaking the test:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530
This patch switches to the name provided by tzdata.
Also check that the new name is actually available.
(cherry picked from commit 46407fe79ca78051cbf6c80e8b8e70a228f9fa50)
Co-authored-by: Jochen Sprickerhof <github@jochen.sprickerhof.de>
-rw-r--r-- | Lib/test/test_email/test_utils.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index 78afb35..81109a7 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -5,6 +5,7 @@ import time import unittest import sys import os.path +import zoneinfo class DateTimeTests(unittest.TestCase): @@ -142,13 +143,9 @@ class LocaltimeTests(unittest.TestCase): t2 = utils.localtime(t0.replace(tzinfo=None)) self.assertEqual(t1, t2) - # XXX: Need a more robust test for Olson's tzdata - @unittest.skipIf(sys.platform.startswith('win'), - "Windows does not use Olson's TZ database") - @unittest.skipUnless(os.path.exists('/usr/share/zoneinfo') or - os.path.exists('/usr/lib/zoneinfo'), - "Can't find the Olson's TZ database") - @test.support.run_with_tz('Europe/Kiev') + @unittest.skipUnless("Europe/Kyiv" in zoneinfo.available_timezones(), + "Can't find a Kyiv timezone database") + @test.support.run_with_tz('Europe/Kyiv') def test_variable_tzname(self): t0 = datetime.datetime(1984, 1, 1, tzinfo=datetime.timezone.utc) t1 = utils.localtime(t0) |