File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 8
8
from pydantic_core import SchemaValidator , TzInfo , core_schema
9
9
10
10
if sys .version_info >= (3 , 9 ):
11
- from zoneinfo import ZoneInfo
11
+ from zoneinfo import ZoneInfo , ZoneInfoNotFoundError
12
12
13
13
14
14
class _ALWAYS_EQ :
@@ -174,10 +174,17 @@ def test_comparison(self):
174
174
estdatetime = self .DT .replace (tzinfo = timezone (- timedelta (hours = 5 )))
175
175
self .assertTrue (self .EST == estdatetime .tzinfo )
176
176
self .assertTrue (tz > estdatetime .tzinfo )
177
+
177
178
if sys .version_info >= (3 , 9 ) and sys .platform == 'linux' :
178
- self .assertFalse (tz == ZoneInfo ('Europe/London' ))
179
- with self .assertRaises (TypeError ):
180
- tz > ZoneInfo ('Europe/London' )
179
+ try :
180
+ europe_london = ZoneInfo ('Europe/London' )
181
+ except ZoneInfoNotFoundError :
182
+ # tz data not available
183
+ pass
184
+ else :
185
+ self .assertFalse (tz == europe_london )
186
+ with self .assertRaises (TypeError ):
187
+ tz > europe_london
181
188
182
189
def test_copy (self ):
183
190
for tz in self .ACDT , self .EST :
You can’t perform that action at this time.
0 commit comments