Skip to content

Commit be63feb

Browse files
committed
move test
1 parent 0eef0cf commit be63feb

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

pandas/tests/extension/decimal/decimal_array/test_decimal.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import operator
12
import decimal
23

34
import random
@@ -275,3 +276,19 @@ def test_compare_array(self, data, all_compare_operators):
275276
other = pd.Series(data) * [decimal.Decimal(pow(2.0, i))
276277
for i in alter]
277278
self._compare_other(s, data, op_name, other)
279+
280+
281+
def test_combine_from_sequence_raises():
282+
# https://github.com/pandas-dev/pandas/issues/22850
283+
class BadDecimalArray(DecimalArray):
284+
def _from_sequence(cls, scalars, dtype=None, copy=False):
285+
raise KeyError("For the test")
286+
287+
ser = pd.Series(BadDecimalArray([decimal.Decimal("1.0"),
288+
decimal.Decimal("2.0")]))
289+
result = ser.combine(ser, operator.add)
290+
291+
# note: object dtype
292+
expected = pd.Series([decimal.Decimal("2.0"),
293+
decimal.Decimal("4.0")], dtype="object")
294+
tm.assert_series_equal(result, expected)

pandas/tests/extension/test_ops.py

-20
This file was deleted.

0 commit comments

Comments
 (0)