diff --git a/pandas/tests/indexes/datetimes/test_timezones.py b/pandas/tests/indexes/datetimes/test_timezones.py index 67eb81336f648..b83645414c8ff 100644 --- a/pandas/tests/indexes/datetimes/test_timezones.py +++ b/pandas/tests/indexes/datetimes/test_timezones.py @@ -738,6 +738,28 @@ def test_dti_drop_dont_lose_tz(self): assert ind.tz is not None + def test_drop_dst_boundary(self): + # see gh-18031 + tz = "Europe/Brussels" + freq = "15min" + + start = pd.Timestamp("201710290100", tz=tz) + end = pd.Timestamp("201710290300", tz=tz) + index = pd.date_range(start=start, end=end, freq=freq) + + expected = DatetimeIndex(["201710290115", "201710290130", + "201710290145", "201710290200", + "201710290215", "201710290230", + "201710290245", "201710290200", + "201710290215", "201710290230", + "201710290245", "201710290300"], + tz=tz, freq=freq, + ambiguous=[True, True, True, True, + True, True, True, False, + False, False, False, False]) + result = index.drop(index[0]) + tm.assert_index_equal(result, expected) + def test_date_range_localize(self): rng = date_range('3/11/2012 03:00', periods=15, freq='H', tz='US/Eastern')