3
3
import pytest
4
4
5
5
from datetime import datetime
6
- from pandas .compat import range , PY3 , long
6
+ from pandas .compat import range , PY3
7
7
8
8
import numpy as np
9
9
18
18
from pandas .tests .indexes .common import Base
19
19
20
20
21
- # For testing division by (or of) zero for Series with length 5, this
22
- # gives several scalar-zeros and length-5 vector-zeros
23
- zeros = [box ([0 ] * 5 , dtype = dtype )
24
- for box in [pd .Index , np .array ]
25
- for dtype in [np .int64 , np .uint64 , np .float64 ]]
26
- zeros .extend ([np .array (0 , dtype = dtype )
27
- for dtype in [np .int64 , np .uint64 , np .float64 ]])
28
- zeros .extend ([0 , 0.0 , long (0 )])
29
-
30
-
31
21
def full_like (array , value ):
32
22
"""Compatibility for numpy<1.8.0
33
23
"""
@@ -167,7 +157,6 @@ def test_divmod_series(self):
167
157
for r , e in zip (result , expected ):
168
158
tm .assert_series_equal (r , e )
169
159
170
- @pytest .mark .parametrize ('zero' , zeros )
171
160
def test_div_zero (self , zero ):
172
161
idx = self .create_index ()
173
162
@@ -178,7 +167,6 @@ def test_div_zero(self, zero):
178
167
ser_compat = Series (idx ).astype ('i8' ) / np .array (zero ).astype ('i8' )
179
168
tm .assert_series_equal (ser_compat , Series (result ))
180
169
181
- @pytest .mark .parametrize ('zero' , zeros )
182
170
def test_floordiv_zero (self , zero ):
183
171
idx = self .create_index ()
184
172
expected = Index ([np .nan , np .inf , np .inf , np .inf , np .inf ],
@@ -189,7 +177,6 @@ def test_floordiv_zero(self, zero):
189
177
ser_compat = Series (idx ).astype ('i8' ) // np .array (zero ).astype ('i8' )
190
178
tm .assert_series_equal (ser_compat , Series (result ))
191
179
192
- @pytest .mark .parametrize ('zero' , zeros )
193
180
def test_mod_zero (self , zero ):
194
181
idx = self .create_index ()
195
182
@@ -200,7 +187,6 @@ def test_mod_zero(self, zero):
200
187
ser_compat = Series (idx ).astype ('i8' ) % np .array (zero ).astype ('i8' )
201
188
tm .assert_series_equal (ser_compat , Series (result ))
202
189
203
- @pytest .mark .parametrize ('zero' , zeros )
204
190
def test_divmod_zero (self , zero ):
205
191
idx = self .create_index ()
206
192
0 commit comments