File tree 1 file changed +4
-7
lines changed 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 5
5
import unittest
6
6
import sys
7
7
import os .path
8
+ import zoneinfo
8
9
9
10
class DateTimeTests (unittest .TestCase ):
10
11
@@ -142,13 +143,9 @@ def test_localtime_epoch_notz_daylight_false(self):
142
143
t2 = utils .localtime (t0 .replace (tzinfo = None ))
143
144
self .assertEqual (t1 , t2 )
144
145
145
- # XXX: Need a more robust test for Olson's tzdata
146
- @unittest .skipIf (sys .platform .startswith ('win' ),
147
- "Windows does not use Olson's TZ database" )
148
- @unittest .skipUnless (os .path .exists ('/usr/share/zoneinfo' ) or
149
- os .path .exists ('/usr/lib/zoneinfo' ),
150
- "Can't find the Olson's TZ database" )
151
- @test .support .run_with_tz ('Europe/Kiev' )
146
+ @unittest .skipUnless ("Europe/Kyiv" in zoneinfo .available_timezones (),
147
+ "Can't find a Kyiv timezone database" )
148
+ @test .support .run_with_tz ('Europe/Kyiv' )
152
149
def test_variable_tzname (self ):
153
150
t0 = datetime .datetime (1984 , 1 , 1 , tzinfo = datetime .timezone .utc )
154
151
t1 = utils .localtime (t0 )
You can’t perform that action at this time.
0 commit comments