mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[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 931d7e052e
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
d63e4c49d3
commit
8046eb0cc8
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue