From 3e2cee4adeff3b5f514d4bc6067fe1ad4bae06ed Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 9 Jan 2024 00:33:53 +0200 Subject: [PATCH] [3.10] gh-113027: Fix test_variable_tzname in test_email (GH-113821) 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 931d7e052e22aa01e18fcc67ed71b6ea305aff71) Co-authored-by: Serhiy Storchaka --- Lib/test/test_email/test_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index 78afb358035e81..51a5bac6dfaa8c 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -152,6 +152,8 @@ def test_localtime_epoch_notz_daylight_false(self): def test_variable_tzname(self): t0 = datetime.datetime(1984, 1, 1, tzinfo=datetime.timezone.utc) t1 = utils.localtime(t0) + if t1.tzname() == 'Europe': + self.skipTest("Can't find a Kyiv timezone database") self.assertEqual(t1.tzname(), 'MSK') t0 = datetime.datetime(1994, 1, 1, tzinfo=datetime.timezone.utc) t1 = utils.localtime(t0)