Skip to content

Commit 5dd3b43

Browse files
authored
TST: xfail some bottleneck on windows (#16240)
* CI: add bottleneck for 3.6 on windows * TST: xfail some bottleneck tests on windows xref #16049 (comment)
1 parent 1a0c878 commit 5dd3b43

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

ci/requirements-3.6_WIN.run

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
python-dateutil
22
pytz
33
numpy=1.12*
4+
bottleneck
45
openpyxl
56
xlsxwriter
67
xlrd

pandas/tests/series/test_analytics.py

+30-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import pandas.core.nanops as nanops
2121

22-
from pandas.compat import lrange, range
22+
from pandas.compat import lrange, range, is_platform_windows
2323
from pandas import compat
2424
from pandas.util.testing import (assert_series_equal, assert_almost_equal,
2525
assert_frame_equal, assert_index_equal)
@@ -28,6 +28,10 @@
2828
from .common import TestData
2929

3030

31+
skip_if_bottleneck_on_windows = (is_platform_windows() and
32+
nanops._USE_BOTTLENECK)
33+
34+
3135
class TestSeriesAnalytics(TestData):
3236

3337
def test_sum_zero(self):
@@ -64,14 +68,6 @@ def test_overflow(self):
6468
result = s.max(skipna=False)
6569
assert int(result) == v[-1]
6670

67-
# use bottleneck if available
68-
result = s.sum()
69-
assert int(result) == v.sum(dtype='int64')
70-
result = s.min()
71-
assert int(result) == 0
72-
result = s.max()
73-
assert int(result) == v[-1]
74-
7571
for dtype in ['float32', 'float64']:
7672
v = np.arange(5000000, dtype=dtype)
7773
s = Series(v)
@@ -84,6 +80,28 @@ def test_overflow(self):
8480
result = s.max(skipna=False)
8581
assert np.allclose(float(result), v[-1])
8682

83+
@pytest.mark.xfail(
84+
skip_if_bottleneck_on_windows,
85+
reason="buggy bottleneck with sum overflow on windows")
86+
def test_overflow_with_bottleneck(self):
87+
# GH 6915
88+
# overflowing on the smaller int dtypes
89+
for dtype in ['int32', 'int64']:
90+
v = np.arange(5000000, dtype=dtype)
91+
s = Series(v)
92+
93+
# use bottleneck if available
94+
result = s.sum()
95+
assert int(result) == v.sum(dtype='int64')
96+
result = s.min()
97+
assert int(result) == 0
98+
result = s.max()
99+
assert int(result) == v[-1]
100+
101+
for dtype in ['float32', 'float64']:
102+
v = np.arange(5000000, dtype=dtype)
103+
s = Series(v)
104+
87105
# use bottleneck if available
88106
result = s.sum()
89107
assert result == v.sum(dtype=dtype)
@@ -92,6 +110,9 @@ def test_overflow(self):
92110
result = s.max()
93111
assert np.allclose(float(result), v[-1])
94112

113+
@pytest.mark.xfail(
114+
skip_if_bottleneck_on_windows,
115+
reason="buggy bottleneck with sum overflow on windows")
95116
def test_sum(self):
96117
self._check_stat_op('sum', np.sum, check_allna=True)
97118

0 commit comments

Comments
 (0)