1
1
from __future__ import annotations
2
2
3
- from datetime import datetime
3
+ import zoneinfo
4
4
5
- import pytz
5
+ from datetime import datetime
6
6
7
7
import pendulum
8
8
@@ -99,7 +99,7 @@ def test_greater_than_false():
99
99
def test_greater_than_with_timezone_true ():
100
100
d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
101
101
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" ))
103
103
104
104
assert d1 > d2
105
105
assert d1 > d3
@@ -108,7 +108,7 @@ def test_greater_than_with_timezone_true():
108
108
def test_greater_than_with_timezone_false ():
109
109
d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
110
110
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" ))
112
112
113
113
assert not d1 > d2
114
114
assert not d1 > d3
@@ -144,7 +144,7 @@ def test_greater_than_or_equal_false():
144
144
def test_greater_than_or_equal_with_timezone_true ():
145
145
d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
146
146
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" ))
148
148
149
149
assert d1 >= d2
150
150
assert d1 >= d3
@@ -153,7 +153,7 @@ def test_greater_than_or_equal_with_timezone_true():
153
153
def test_greater_than_or_equal_with_timezone_false ():
154
154
d1 = pendulum .datetime (2000 , 1 , 1 , 12 , 0 , 0 , tz = "America/Toronto" )
155
155
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" ))
157
157
158
158
assert not d1 >= d2
159
159
assert not d1 >= d3
@@ -180,7 +180,7 @@ def test_less_than_false():
180
180
def test_less_than_with_timezone_true ():
181
181
d1 = pendulum .datetime (2000 , 1 , 1 , 8 , 59 , 59 , tz = "America/Vancouver" )
182
182
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" ))
184
184
185
185
assert d1 < d2
186
186
assert d1 < d3
@@ -189,7 +189,7 @@ def test_less_than_with_timezone_true():
189
189
def test_less_than_with_timezone_false ():
190
190
d1 = pendulum .datetime (2000 , 1 , 1 , 9 , 0 , 1 , tz = "America/Vancouver" )
191
191
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" ))
193
193
194
194
assert not d1 < d2
195
195
assert not d1 < d3
@@ -225,7 +225,7 @@ def test_less_than_or_equal_false():
225
225
def test_less_than_or_equal_with_timezone_true ():
226
226
d1 = pendulum .datetime (2000 , 1 , 1 , 8 , 59 , 59 , tz = "America/Vancouver" )
227
227
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" ))
229
229
230
230
assert d1 <= d2
231
231
assert d1 <= d3
@@ -234,7 +234,7 @@ def test_less_than_or_equal_with_timezone_true():
234
234
def test_less_than_or_equal_with_timezone_false ():
235
235
d1 = pendulum .datetime (2000 , 1 , 1 , 9 , 0 , 1 , tz = "America/Vancouver" )
236
236
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" ))
238
238
239
239
assert not d1 <= d2
240
240
assert not d1 <= d3
0 commit comments