Skip to content

Commit

Permalink
TST: add coverage of DST transition to dti tz_localize roundtrip test p…
Browse files Browse the repository at this point in the history
  • Loading branch information
robbuckley committed Jan 10, 2019
1 parent 7c842b0 commit 51c8c2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def unique_nulls_fixture(request):
unique_nulls_fixture2 = unique_nulls_fixture


TIMEZONES = [None, 'UTC', 'US/Eastern', 'Asia/Tokyo', 'dateutil/US/Pacific',
TIMEZONES = [None, 'UTC', 'Europe/London', 'US/Eastern', 'Asia/Tokyo', 'dateutil/US/Pacific',
'dateutil/Asia/Singapore', tzutc(), tzlocal(), FixedOffset(300),
FixedOffset(0), FixedOffset(-300)]

Expand Down
8 changes: 3 additions & 5 deletions pandas/tests/indexes/datetimes/test_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,13 @@ def test_dti_tz_localize_utc_conversion(self, tz):
])
def test_dti_tz_localize_roundtrip(self, tz_aware_fixture, idx):
tz = tz_aware_fixture
localized = idx.tz_localize(tz)
expected = date_range(start=idx[0], end=idx[-1], freq=idx.freq,
tz=tz)
tm.assert_index_equal(localized, expected)
localized = idx.tz_localize(tz, ambiguous='NaT')

with pytest.raises(TypeError):
localized.tz_localize(tz)

reset = localized.tz_localize(None)
tm.assert_index_equal(reset, idx)
assert reset.difference(idx).dropna().empty
assert reset.tzinfo is None

def test_dti_tz_localize_naive(self):
Expand Down

0 comments on commit 51c8c2b

Please sign in to comment.