@@ -65,7 +65,7 @@ def test_tz_localize_pushes_out_of_bounds(self):
65
65
def test_tz_localize_ambiguous_bool (self , unit ):
66
66
# make sure that we are correctly accepting bool values as ambiguous
67
67
# GH#14402
68
- ts = Timestamp ("2015-11-01 01:00:03" )._as_unit (unit )
68
+ ts = Timestamp ("2015-11-01 01:00:03" ).as_unit (unit )
69
69
expected0 = Timestamp ("2015-11-01 01:00:03-0500" , tz = "US/Central" )
70
70
expected1 = Timestamp ("2015-11-01 01:00:03-0600" , tz = "US/Central" )
71
71
@@ -261,7 +261,7 @@ def test_timestamp_tz_localize_nonexistent_shift(
261
261
tz = tz_type + tz
262
262
if isinstance (shift , str ):
263
263
shift = "shift_" + shift
264
- ts = Timestamp (start_ts )._as_unit (unit )
264
+ ts = Timestamp (start_ts ).as_unit (unit )
265
265
result = ts .tz_localize (tz , nonexistent = shift )
266
266
expected = Timestamp (end_ts ).tz_localize (tz )
267
267
@@ -290,15 +290,15 @@ def test_timestamp_tz_localize_nonexistent_shift_invalid(self, offset, tz_type):
290
290
@pytest .mark .parametrize ("unit" , ["ns" , "us" , "ms" , "s" ])
291
291
def test_timestamp_tz_localize_nonexistent_NaT (self , tz , unit ):
292
292
# GH 8917
293
- ts = Timestamp ("2015-03-29 02:20:00" )._as_unit (unit )
293
+ ts = Timestamp ("2015-03-29 02:20:00" ).as_unit (unit )
294
294
result = ts .tz_localize (tz , nonexistent = "NaT" )
295
295
assert result is NaT
296
296
297
297
@pytest .mark .parametrize ("tz" , ["Europe/Warsaw" , "dateutil/Europe/Warsaw" ])
298
298
@pytest .mark .parametrize ("unit" , ["ns" , "us" , "ms" , "s" ])
299
299
def test_timestamp_tz_localize_nonexistent_raise (self , tz , unit ):
300
300
# GH 8917
301
- ts = Timestamp ("2015-03-29 02:20:00" )._as_unit (unit )
301
+ ts = Timestamp ("2015-03-29 02:20:00" ).as_unit (unit )
302
302
msg = "2015-03-29 02:20:00"
303
303
with pytest .raises (pytz .NonExistentTimeError , match = msg ):
304
304
ts .tz_localize (tz , nonexistent = "raise" )
0 commit comments