diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-01-12 12:00:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 12:00:17 (GMT) |
commit | 8046eb0cc89a66b93616501c1d7d199a59e998d4 (patch) | |
tree | 7f1a6ce27fc7f8dbf412fe0c96b0724353da4510 /Lib/test | |
parent | d63e4c49d3d1080ff53338fea3b37220161d1891 (diff) | |
download | cpython-8046eb0cc89a66b93616501c1d7d199a59e998d4.zip cpython-8046eb0cc89a66b93616501c1d7d199a59e998d4.tar.gz cpython-8046eb0cc89a66b93616501c1d7d199a59e998d4.tar.bz2 |
[3.12] gh-113027: Fix test_variable_tzname in test_email (GH-113821) (GH-113831)
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 <storchaka@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_email/test_utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index c9d973d..d04b390 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -143,12 +143,12 @@ class LocaltimeTests(unittest.TestCase): t2 = utils.localtime(t0.replace(tzinfo=None)) self.assertEqual(t1, t2) - @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) + if t1.tzname() in ('Europe', 'UTC'): + 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) |