11from __future__ import annotations
22
3- from datetime import datetime
3+ import zoneinfo
44
5- import pytz
5+ from datetime import datetime
66
77import pendulum
88
@@ -99,7 +99,7 @@ def test_greater_than_false():
9999def test_greater_than_with_timezone_true ():
100100 d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
101101 d2 = pendulum .datetime (2000 , 1 , 1 , 8 , 59 , 59 , tz = "America/Vancouver" )
102- d3 = pytz . timezone ( "America/Vancouver" ). localize ( datetime (2000 , 1 , 1 , 8 , 59 , 59 ))
102+ d3 = datetime (2000 , 1 , 1 , 8 , 59 , 59 , tzinfo = zoneinfo . ZoneInfo ( "America/Vancouver" ))
103103
104104 assert d1 > d2
105105 assert d1 > d3
@@ -108,7 +108,7 @@ def test_greater_than_with_timezone_true():
108108def test_greater_than_with_timezone_false ():
109109 d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
110110 d2 = pendulum .datetime (2000 , 1 , 1 , 9 , 0 , 1 , tz = "America/Vancouver" )
111- d3 = pytz . timezone ( "America/Vancouver" ). localize ( datetime (2000 , 1 , 1 , 9 , 0 , 1 ))
111+ d3 = datetime (2000 , 1 , 1 , 9 , 0 , 1 , tzinfo = zoneinfo . ZoneInfo ( "America/Vancouver" ))
112112
113113 assert not d1 > d2
114114 assert not d1 > d3
@@ -144,7 +144,7 @@ def test_greater_than_or_equal_false():
144144def test_greater_than_or_equal_with_timezone_true ():
145145 d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
146146 d2 = pendulum .datetime (2000 , 1 , 1 , 8 , 59 , 59 , tz = "America/Vancouver" )
147- d3 = pytz . timezone ( "America/Vancouver" ). localize ( datetime (2000 , 1 , 1 , 8 , 59 , 59 ))
147+ d3 = datetime (2000 , 1 , 1 , 8 , 59 , 59 , tzinfo = zoneinfo . ZoneInfo ( "America/Vancouver" ))
148148
149149 assert d1 >= d2
150150 assert d1 >= d3
@@ -153,7 +153,7 @@ def test_greater_than_or_equal_with_timezone_true():
153153def test_greater_than_or_equal_with_timezone_false ():
154154 d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
155155 d2 = pendulum .datetime (2000 , 1 , 1 , 9 , 0 , 1 , tz = "America/Vancouver" )
156- d3 = pytz . timezone ( "America/Vancouver" ). localize ( datetime (2000 , 1 , 1 , 9 , 0 , 1 ))
156+ d3 = datetime (2000 , 1 , 1 , 9 , 0 , 1 , tzinfo = zoneinfo . ZoneInfo ( "America/Vancouver" ))
157157
158158 assert not d1 >= d2
159159 assert not d1 >= d3
@@ -180,7 +180,7 @@ def test_less_than_false():
180180def test_less_than_with_timezone_true ():
181181 d1 = pendulum .datetime (2000 , 1 , 1 , 8 , 59 , 59 , tz = "America/Vancouver" )
182182 d2 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
183- d3 = pytz . timezone ( "America/Toronto" ). localize ( datetime (2000 , 1 , 1 , 12 , 0 , 0 ))
183+ d3 = datetime (2000 , 1 , 1 , 12 , 0 , 0 , tzinfo = zoneinfo . ZoneInfo ( "America/Toronto" ))
184184
185185 assert d1 < d2
186186 assert d1 < d3
@@ -189,7 +189,7 @@ def test_less_than_with_timezone_true():
189189def test_less_than_with_timezone_false ():
190190 d1 = pendulum .datetime (2000 , 1 , 1 , 9 , 0 , 1 , tz = "America/Vancouver" )
191191 d2 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
192- d3 = pytz . timezone ( "America/Toronto" ). localize ( datetime (2000 , 1 , 1 , 12 , 0 , 0 ))
192+ d3 = datetime (2000 , 1 , 1 , 12 , 0 , 0 , tzinfo = zoneinfo . ZoneInfo ( "America/Toronto" ))
193193
194194 assert not d1 < d2
195195 assert not d1 < d3
@@ -225,7 +225,7 @@ def test_less_than_or_equal_false():
225225def test_less_than_or_equal_with_timezone_true ():
226226 d1 = pendulum .datetime (2000 , 1 , 1 , 8 , 59 , 59 , tz = "America/Vancouver" )
227227 d2 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
228- d3 = pytz . timezone ( "America/Toronto" ). localize ( datetime (2000 , 1 , 1 , 12 , 0 , 0 ))
228+ d3 = datetime (2000 , 1 , 1 , 12 , 0 , 0 , tzinfo = zoneinfo . ZoneInfo ( "America/Toronto" ))
229229
230230 assert d1 <= d2
231231 assert d1 <= d3
@@ -234,7 +234,7 @@ def test_less_than_or_equal_with_timezone_true():
234234def test_less_than_or_equal_with_timezone_false ():
235235 d1 = pendulum .datetime (2000 , 1 , 1 , 9 , 0 , 1 , tz = "America/Vancouver" )
236236 d2 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
237- d3 = pytz . timezone ( "America/Toronto" ). localize ( datetime (2000 , 1 , 1 , 12 , 0 , 0 ))
237+ d3 = datetime (2000 , 1 , 1 , 12 , 0 , 0 , tzinfo = zoneinfo . ZoneInfo ( "America/Toronto" ))
238238
239239 assert not d1 <= d2
240240 assert not d1 <= d3
0 commit comments