0
0
mirror of https://github.com/python/cpython.git synced 2024-11-24 00:38:00 +01:00

[3.9] gh-113027: Fix test_variable_tzname in test_email (GH-113821) (GH-126477)

Determine the support of the Kyiv timezone by checking the result of
astimezone() which uses the system tz database and not the one
populated by zoneinfo.

(cherry picked from commit 931d7e052e)
This commit is contained in:
Petr Viktorin 2024-11-12 10:26:31 +01:00 committed by GitHub
parent 011fb84db5
commit fb0b642bf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,6 +133,8 @@ class LocaltimeTests(unittest.TestCase):
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)
if t1.tzname() == 'Europe':
self.skipTest("Can't find a Kyiv timezone database")
self.assertEqual(t1.tzname(), 'MSK') self.assertEqual(t1.tzname(), 'MSK')
t0 = datetime.datetime(1994, 1, 1, tzinfo=datetime.timezone.utc) t0 = datetime.datetime(1994, 1, 1, tzinfo=datetime.timezone.utc)
t1 = utils.localtime(t0) t1 = utils.localtime(t0)