Skip to content

Commit 9de356a

Browse files
committed
revert fixture to fix test_range failures
1 parent b8cf21d commit 9de356a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

pandas/tests/indexes/test_numeric.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from pandas.tests.indexes.common import Base
1919

2020

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

2830

29-
@pytest.fixture(params=zeros)
30-
def zero(request):
31-
"""
32-
For testing division by (or of) zero for Series with length 5, this
33-
gives several scalar-zeros and length-5 vector-zeros
34-
"""
35-
return request.param
36-
37-
3831
def full_like(array, value):
3932
"""Compatibility for numpy<1.8.0
4033
"""
@@ -174,6 +167,7 @@ def test_divmod_series(self):
174167
for r, e in zip(result, expected):
175168
tm.assert_series_equal(r, e)
176169

170+
@pytest.mark.parametrize('zero', zeros)
177171
def test_div_zero(self, zero):
178172
idx = self.create_index()
179173

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

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

192+
@pytest.mark.parametrize('zero', zeros)
197193
def test_mod_zero(self, zero):
198194
idx = self.create_index()
199195

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

203+
@pytest.mark.parametrize('zero', zeros)
207204
def test_divmod_zero(self, zero):
208205
idx = self.create_index()
209206

0 commit comments

Comments
 (0)