Skip to content

Commit

Permalink
remove operator.div for py3
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Jan 23, 2018
1 parent 6acc2f7 commit 84c74c5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pandas/tests/indexes/test_numeric.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import operator

import pytest

Expand Down Expand Up @@ -163,16 +162,15 @@ def test_divmod_series(self):
for r, e in zip(result, expected):
tm.assert_series_equal(r, e)

@pytest.mark.parametrize('op', [operator.div, operator.truediv])
@pytest.mark.parametrize('zero', zeros)
def test_div_zero(self, zero, op):
def test_div_zero(self, zero):
idx = self.create_index()

expected = Index([np.nan, np.inf, np.inf, np.inf, np.inf],
dtype=np.float64)
result = op(idx, zero)
result = idx / zero
tm.assert_index_equal(result, expected)
ser_compat = op(Series(idx).astype('i8'), np.array(zero).astype('i8'))
ser_compat = Series(idx).astype('i8') / np.array(zero).astype('i8')
tm.assert_series_equal(ser_compat, Series(result))

@pytest.mark.parametrize('zero', zeros)
Expand Down

0 comments on commit 84c74c5

Please sign in to comment.