Skip to content

Commit 4fd071c

Browse files
author
MomIsBestFriend
committed
TST: Cleaned tests
1 parent f7bed05 commit 4fd071c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

pandas/tests/tseries/offsets/test_offsets_properties.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@
8585
# Offset-specific behaviour tests
8686

8787

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")
9088
@given(gen_random_datetime, gen_yqm_offset)
9189
def test_on_offset_implementations(dt, offset):
9290
assume(not offset.normalize)
@@ -98,15 +96,19 @@ def test_on_offset_implementations(dt, offset):
9896

9997

10098
@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+
)
105105
)
106106
@given(gen_yqm_offset, gen_date_range)
107107
def test_apply_index_implementations(offset, rng):
108108
# 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)
110112

111113
# rng = pd.date_range(start='1/1/2000', periods=100000, freq='T')
112114
ser = pd.Series(rng)
@@ -116,13 +118,14 @@ def test_apply_index_implementations(offset, rng):
116118
# res_v2 = offset.apply_index(rng.tz_localize(None)).tz_localize(rng.tz)
117119
assert (res == res_v2).all()
118120

121+
# apply_index is only for indexes, not series, so no res2_v2
119122
assert res[0] == rng[0] + offset
120123
assert res[-1] == rng[-1] + offset
121124
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
123127
assert res2.iloc[0] == ser.iloc[0] + offset
124128
assert res2.iloc[-1] == ser.iloc[-1] + offset
125-
# TODO: Check randomly assorted entries, not just first/last
126129

127130

128131
@pytest.mark.xfail # TODO: reason?

0 commit comments

Comments
 (0)