]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] gh-113027: Fix test_variable_tzname in test_email (GH-113821) (GH-126477)
authorPetr Viktorin <encukou@gmail.com>
Tue, 12 Nov 2024 09:26:31 +0000 (10:26 +0100)
committerGitHub <noreply@github.com>
Tue, 12 Nov 2024 09:26:31 +0000 (10:26 +0100)
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)

Lib/test/test_email/test_utils.py

index 4e3c3f3a195fc48124d28e69f56df5ab26048fbc..695223334bc4fda550b62bd7ddfc0bac23f26a52 100644 (file)
@@ -133,6 +133,8 @@ class LocaltimeTests(unittest.TestCase):
     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)