Skip to content

Commit

Permalink
move test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Oct 2, 2018
1 parent 0eef0cf commit be63feb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
17 changes: 17 additions & 0 deletions pandas/tests/extension/decimal/decimal_array/test_decimal.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import operator
import decimal

import random
Expand Down Expand Up @@ -275,3 +276,19 @@ def test_compare_array(self, data, all_compare_operators):
other = pd.Series(data) * [decimal.Decimal(pow(2.0, i))
for i in alter]
self._compare_other(s, data, op_name, other)


def test_combine_from_sequence_raises():
# https://github.com/pandas-dev/pandas/issues/22850
class BadDecimalArray(DecimalArray):
def _from_sequence(cls, scalars, dtype=None, copy=False):
raise KeyError("For the test")

ser = pd.Series(BadDecimalArray([decimal.Decimal("1.0"),
decimal.Decimal("2.0")]))
result = ser.combine(ser, operator.add)

# note: object dtype
expected = pd.Series([decimal.Decimal("2.0"),
decimal.Decimal("4.0")], dtype="object")
tm.assert_series_equal(result, expected)
20 changes: 0 additions & 20 deletions pandas/tests/extension/test_ops.py

This file was deleted.

0 comments on commit be63feb

Please sign in to comment.