Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 931d7e0

Browse files
gh-113027: Fix test_variable_tzname in test_email (#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.
1 parent 92f9624 commit 931d7e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_email/test_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ def test_localtime_epoch_notz_daylight_false(self):
143143
t2 = utils.localtime(t0.replace(tzinfo=None))
144144
self.assertEqual(t1, t2)
145145

146-
@unittest.skipUnless("Europe/Kyiv" in zoneinfo.available_timezones(),
147-
"Can't find a Kyiv timezone database")
148146
@test.support.run_with_tz('Europe/Kyiv')
149147
def test_variable_tzname(self):
150148
t0 = datetime.datetime(1984, 1, 1, tzinfo=datetime.timezone.utc)
151149
t1 = utils.localtime(t0)
150+
if t1.tzname() == 'Europe':
151+
self.skipTest("Can't find a Kyiv timezone database")
152152
self.assertEqual(t1.tzname(), 'MSK')
153153
t0 = datetime.datetime(1994, 1, 1, tzinfo=datetime.timezone.utc)
154154
t1 = utils.localtime(t0)

0 commit comments

Comments
 (0)