Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Oct 2, 2018
1 parent 1b4261f commit 0671e7d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
19 changes: 18 additions & 1 deletion pandas/tests/extension/decimal/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pandas.tests.extension import base

from .array import DecimalDtype, DecimalArray
from .array import DecimalDtype, DecimalArray, to_decimal


def make_data():
Expand Down Expand Up @@ -244,6 +244,23 @@ def test_arith_series_with_array(self, data, all_arithmetic_operators):
context.traps[decimal.DivisionByZero] = divbyzerotrap
context.traps[decimal.InvalidOperation] = invalidoptrap

@pytest.mark.parametrize("reverse, expected_div, expected_mod", [
(False, [0, 1, 1, 2], [1, 0, 1, 0]),
(True, [2, 1, 0, 0], [0, 0, 2, 2]),
])
def test_divmod_array(self, reverse, expected_div, expected_mod):
# https://github.com/pandas-dev/pandas/issues/22930
arr = to_decimal([1, 2, 3, 4])
if reverse:
div, mod = divmod(2, arr)
else:
div, mod = divmod(arr, 2)
expected_div = to_decimal(expected_div)
expected_mod = to_decimal(expected_mod)

tm.assert_extension_array_equal(div, expected_div)
tm.assert_extension_array_equal(mod, expected_mod)

def test_divmod(self, data):
s = pd.Series(data, name='name')
a, b = divmod(s, 2)
Expand Down
22 changes: 0 additions & 22 deletions pandas/tests/extension/test_ops.py

This file was deleted.

0 comments on commit 0671e7d

Please sign in to comment.