85
85
# Offset-specific behaviour tests
86
86
87
87
88
- # Based on CI runs: Always passes on OSX, fails on Linux, sometimes on Windows
89
- @pytest .mark .xfail (strict = False , reason = "inconsistent between OSs, Pythons" )
90
88
@given (gen_random_datetime , gen_yqm_offset )
91
89
def test_on_offset_implementations (dt , offset ):
92
90
assume (not offset .normalize )
@@ -98,15 +96,19 @@ def test_on_offset_implementations(dt, offset):
98
96
99
97
100
98
@pytest .mark .xfail (
101
- reason = "res_v2 below is incorrect, needs to use the "
102
- "commented-out version with tz_localize. "
103
- "But with that fix in place, hypothesis then "
104
- "has errors in timezone generation."
99
+ reason = (
100
+ "res_v2 below is incorrect, needs to use the "
101
+ "commented-out version with tz_localize. "
102
+ "But with that fix in place, hypothesis then "
103
+ "has errors in timezone generation."
104
+ )
105
105
)
106
106
@given (gen_yqm_offset , gen_date_range )
107
107
def test_apply_index_implementations (offset , rng ):
108
108
# offset.apply_index(dti)[i] should match dti[i] + offset
109
- assume (offset .n != 0 ) # TODO: test for that case separately
109
+
110
+ # TODO: test for that case separately
111
+ assume (offset .n != 0 )
110
112
111
113
# rng = pd.date_range(start='1/1/2000', periods=100000, freq='T')
112
114
ser = pd .Series (rng )
@@ -116,13 +118,14 @@ def test_apply_index_implementations(offset, rng):
116
118
# res_v2 = offset.apply_index(rng.tz_localize(None)).tz_localize(rng.tz)
117
119
assert (res == res_v2 ).all ()
118
120
121
+ # apply_index is only for indexes, not series, so no res2_v2
119
122
assert res [0 ] == rng [0 ] + offset
120
123
assert res [- 1 ] == rng [- 1 ] + offset
121
124
res2 = ser + offset
122
- # apply_index is only for indexes, not series, so no res2_v2
125
+
126
+ # TODO: Check randomly assorted entries, not just first/last
123
127
assert res2 .iloc [0 ] == ser .iloc [0 ] + offset
124
128
assert res2 .iloc [- 1 ] == ser .iloc [- 1 ] + offset
125
- # TODO: Check randomly assorted entries, not just first/last
126
129
127
130
128
131
@pytest .mark .xfail # TODO: reason?
0 commit comments