Skip to content

Commit

Permalink
TST: xfail some bottleneck on windows (#16240)
Browse files Browse the repository at this point in the history
* CI: add bottleneck for 3.6 on windows

* TST: xfail some bottleneck tests on windows

xref #16049 (comment)
  • Loading branch information
jreback authored May 4, 2017
1 parent 1a0c878 commit 5dd3b43
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
1 change: 1 addition & 0 deletions ci/requirements-3.6_WIN.run
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
python-dateutil
pytz
numpy=1.12*
bottleneck
openpyxl
xlsxwriter
xlrd
Expand Down
39 changes: 30 additions & 9 deletions pandas/tests/series/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import pandas.core.nanops as nanops

from pandas.compat import lrange, range
from pandas.compat import lrange, range, is_platform_windows
from pandas import compat
from pandas.util.testing import (assert_series_equal, assert_almost_equal,
assert_frame_equal, assert_index_equal)
Expand All @@ -28,6 +28,10 @@
from .common import TestData


skip_if_bottleneck_on_windows = (is_platform_windows() and
nanops._USE_BOTTLENECK)


class TestSeriesAnalytics(TestData):

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

# use bottleneck if available
result = s.sum()
assert int(result) == v.sum(dtype='int64')
result = s.min()
assert int(result) == 0
result = s.max()
assert int(result) == v[-1]

for dtype in ['float32', 'float64']:
v = np.arange(5000000, dtype=dtype)
s = Series(v)
Expand All @@ -84,6 +80,28 @@ def test_overflow(self):
result = s.max(skipna=False)
assert np.allclose(float(result), v[-1])

@pytest.mark.xfail(
skip_if_bottleneck_on_windows,
reason="buggy bottleneck with sum overflow on windows")
def test_overflow_with_bottleneck(self):
# GH 6915
# overflowing on the smaller int dtypes
for dtype in ['int32', 'int64']:
v = np.arange(5000000, dtype=dtype)
s = Series(v)

# use bottleneck if available
result = s.sum()
assert int(result) == v.sum(dtype='int64')
result = s.min()
assert int(result) == 0
result = s.max()
assert int(result) == v[-1]

for dtype in ['float32', 'float64']:
v = np.arange(5000000, dtype=dtype)
s = Series(v)

# use bottleneck if available
result = s.sum()
assert result == v.sum(dtype=dtype)
Expand All @@ -92,6 +110,9 @@ def test_overflow(self):
result = s.max()
assert np.allclose(float(result), v[-1])

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

Expand Down

0 comments on commit 5dd3b43

Please sign in to comment.