move test · tm9k1/pandas@be63feb (original) (raw)

``

1

`+

import operator

`

1

2

`import decimal

`

2

3

``

3

4

`import random

`

`@@ -275,3 +276,19 @@ def test_compare_array(self, data, all_compare_operators):

`

275

276

`other = pd.Series(data) * [decimal.Decimal(pow(2.0, i))

`

276

277

`for i in alter]

`

277

278

`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)

`