Skip to content

Commit 296320a

Browse files
committed
fixed error in test cases
1 parent 4650eb4 commit 296320a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/scalar/timestamp/test_timezones.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_tz_localize_pushes_out_of_bounds(self):
6565
def test_tz_localize_ambiguous_bool(self, unit):
6666
# make sure that we are correctly accepting bool values as ambiguous
6767
# 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)
6969
expected0 = Timestamp("2015-11-01 01:00:03-0500", tz="US/Central")
7070
expected1 = Timestamp("2015-11-01 01:00:03-0600", tz="US/Central")
7171

@@ -261,7 +261,7 @@ def test_timestamp_tz_localize_nonexistent_shift(
261261
tz = tz_type + tz
262262
if isinstance(shift, str):
263263
shift = "shift_" + shift
264-
ts = Timestamp(start_ts)._as_unit(unit)
264+
ts = Timestamp(start_ts).as_unit(unit)
265265
result = ts.tz_localize(tz, nonexistent=shift)
266266
expected = Timestamp(end_ts).tz_localize(tz)
267267

@@ -290,15 +290,15 @@ def test_timestamp_tz_localize_nonexistent_shift_invalid(self, offset, tz_type):
290290
@pytest.mark.parametrize("unit", ["ns", "us", "ms", "s"])
291291
def test_timestamp_tz_localize_nonexistent_NaT(self, tz, unit):
292292
# 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)
294294
result = ts.tz_localize(tz, nonexistent="NaT")
295295
assert result is NaT
296296

297297
@pytest.mark.parametrize("tz", ["Europe/Warsaw", "dateutil/Europe/Warsaw"])
298298
@pytest.mark.parametrize("unit", ["ns", "us", "ms", "s"])
299299
def test_timestamp_tz_localize_nonexistent_raise(self, tz, unit):
300300
# 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)
302302
msg = "2015-03-29 02:20:00"
303303
with pytest.raises(pytz.NonExistentTimeError, match=msg):
304304
ts.tz_localize(tz, nonexistent="raise")

0 commit comments

Comments
 (0)