|
12 | 12 | from hypothesis import assume, given, strategies as st
|
13 | 13 | from hypothesis.extra.dateutil import timezones as dateutil_timezones
|
14 | 14 | from hypothesis.extra.pytz import timezones as pytz_timezones
|
15 |
| -import pytest |
16 | 15 |
|
17 | 16 | import pandas as pd
|
18 | 17 | from pandas import Timestamp
|
@@ -95,34 +94,6 @@ def test_on_offset_implementations(dt, offset):
|
95 | 94 | assert offset.is_on_offset(dt) == (compare == dt)
|
96 | 95 |
|
97 | 96 |
|
98 |
| -@pytest.mark.xfail( |
99 |
| - reason="res_v2 below is incorrect, needs to use the " |
100 |
| - "commented-out version with tz_localize. " |
101 |
| - "But with that fix in place, hypothesis then " |
102 |
| - "has errors in timezone generation." |
103 |
| -) |
104 |
| -@given(gen_yqm_offset, gen_date_range) |
105 |
| -def test_apply_index_implementations(offset, rng): |
106 |
| - # offset.apply_index(dti)[i] should match dti[i] + offset |
107 |
| - assume(offset.n != 0) # TODO: test for that case separately |
108 |
| - |
109 |
| - # rng = pd.date_range(start='1/1/2000', periods=100000, freq='T') |
110 |
| - ser = pd.Series(rng) |
111 |
| - |
112 |
| - res = rng + offset |
113 |
| - res_v2 = offset.apply_index(rng) |
114 |
| - # res_v2 = offset.apply_index(rng.tz_localize(None)).tz_localize(rng.tz) |
115 |
| - assert (res == res_v2).all() |
116 |
| - |
117 |
| - assert res[0] == rng[0] + offset |
118 |
| - assert res[-1] == rng[-1] + offset |
119 |
| - res2 = ser + offset |
120 |
| - # apply_index is only for indexes, not series, so no res2_v2 |
121 |
| - assert res2.iloc[0] == ser.iloc[0] + offset |
122 |
| - assert res2.iloc[-1] == ser.iloc[-1] + offset |
123 |
| - # TODO: Check randomly assorted entries, not just first/last |
124 |
| - |
125 |
| - |
126 | 97 | @given(gen_yqm_offset)
|
127 | 98 | def test_shift_across_dst(offset):
|
128 | 99 | # GH#18319 check that 1) timezone is correctly normalized and
|
|
0 commit comments