Skip to content

Commit

Permalink
revert fixture to fix test_range failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Feb 1, 2018
1 parent b8cf21d commit 9de356a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pandas/tests/indexes/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from pandas.tests.indexes.common import Base


# For testing division by (or of) zero for Series with length 5, this
# gives several scalar-zeros and length-5 vector-zeros
zeros = [box([0] * 5, dtype=dtype)
for box in [pd.Index, np.array]
for dtype in [np.int64, np.uint64, np.float64]]
Expand All @@ -26,15 +28,6 @@
zeros.extend([0, 0.0, long(0)])


@pytest.fixture(params=zeros)
def zero(request):
"""
For testing division by (or of) zero for Series with length 5, this
gives several scalar-zeros and length-5 vector-zeros
"""
return request.param


def full_like(array, value):
"""Compatibility for numpy<1.8.0
"""
Expand Down Expand Up @@ -174,6 +167,7 @@ def test_divmod_series(self):
for r, e in zip(result, expected):
tm.assert_series_equal(r, e)

@pytest.mark.parametrize('zero', zeros)
def test_div_zero(self, zero):
idx = self.create_index()

Expand All @@ -184,6 +178,7 @@ def test_div_zero(self, zero):
ser_compat = Series(idx).astype('i8') / np.array(zero).astype('i8')
tm.assert_series_equal(ser_compat, Series(result))

@pytest.mark.parametrize('zero', zeros)
def test_floordiv_zero(self, zero):
idx = self.create_index()
expected = Index([np.nan, np.inf, np.inf, np.inf, np.inf],
Expand All @@ -194,6 +189,7 @@ def test_floordiv_zero(self, zero):
ser_compat = Series(idx).astype('i8') // np.array(zero).astype('i8')
tm.assert_series_equal(ser_compat, Series(result))

@pytest.mark.parametrize('zero', zeros)
def test_mod_zero(self, zero):
idx = self.create_index()

Expand All @@ -204,6 +200,7 @@ def test_mod_zero(self, zero):
ser_compat = Series(idx).astype('i8') % np.array(zero).astype('i8')
tm.assert_series_equal(ser_compat, Series(result))

@pytest.mark.parametrize('zero', zeros)
def test_divmod_zero(self, zero):
idx = self.create_index()

Expand Down

0 comments on commit 9de356a

Please sign in to comment.