mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] gh-109017: Use non alternate name for Kyiv (GH-109251) (GH-111280)
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 46407fe79c
)
Co-authored-by: Jochen Sprickerhof <github@jochen.sprickerhof.de>
This commit is contained in:
parent
b180120468
commit
b6e508cc86
1 changed files with 4 additions and 7 deletions
|
@ -5,6 +5,7 @@ import time
|
||||||
import unittest
|
import unittest
|
||||||
import sys
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
|
import zoneinfo
|
||||||
|
|
||||||
class DateTimeTests(unittest.TestCase):
|
class DateTimeTests(unittest.TestCase):
|
||||||
|
|
||||||
|
@ -142,13 +143,9 @@ class LocaltimeTests(unittest.TestCase):
|
||||||
t2 = utils.localtime(t0.replace(tzinfo=None))
|
t2 = utils.localtime(t0.replace(tzinfo=None))
|
||||||
self.assertEqual(t1, t2)
|
self.assertEqual(t1, t2)
|
||||||
|
|
||||||
# XXX: Need a more robust test for Olson's tzdata
|
@unittest.skipUnless("Europe/Kyiv" in zoneinfo.available_timezones(),
|
||||||
@unittest.skipIf(sys.platform.startswith('win'),
|
"Can't find a Kyiv timezone database")
|
||||||
"Windows does not use Olson's TZ database")
|
@test.support.run_with_tz('Europe/Kyiv')
|
||||||
@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')
|
|
||||||
def test_variable_tzname(self):
|
def test_variable_tzname(self):
|
||||||
t0 = datetime.datetime(1984, 1, 1, tzinfo=datetime.timezone.utc)
|
t0 = datetime.datetime(1984, 1, 1, tzinfo=datetime.timezone.utc)
|
||||||
t1 = utils.localtime(t0)
|
t1 = utils.localtime(t0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue