|
8 | 8 | import numpy as np
|
9 | 9 | import pytest
|
10 | 10 |
|
11 |
| -from pandas._config import using_string_dtype |
12 |
| - |
13 |
| -from pandas.compat import HAS_PYARROW |
14 | 11 | import pandas.util._test_decorators as td
|
15 | 12 |
|
16 | 13 | import pandas as pd
|
@@ -318,27 +315,17 @@ def test_add(self):
|
318 | 315 | expected = pd.Index(["1a", "1b", "1c"])
|
319 | 316 | tm.assert_index_equal("1" + index, expected)
|
320 | 317 |
|
321 |
| - @pytest.mark.xfail( |
322 |
| - using_string_dtype() and not HAS_PYARROW, reason="TODO(infer_string)" |
323 |
| - ) |
324 |
| - def test_sub_fail(self, using_infer_string): |
| 318 | + def test_sub_fail(self): |
325 | 319 | index = pd.Index([str(i) for i in range(10)])
|
326 | 320 |
|
327 |
| - if using_infer_string: |
328 |
| - import pyarrow as pa |
329 |
| - |
330 |
| - err = pa.lib.ArrowNotImplementedError |
331 |
| - msg = "has no kernel" |
332 |
| - else: |
333 |
| - err = TypeError |
334 |
| - msg = "unsupported operand type|Cannot broadcast" |
335 |
| - with pytest.raises(err, match=msg): |
| 321 | + msg = "unsupported operand type|Cannot broadcast|sub' not supported" |
| 322 | + with pytest.raises(TypeError, match=msg): |
336 | 323 | index - "a"
|
337 |
| - with pytest.raises(err, match=msg): |
| 324 | + with pytest.raises(TypeError, match=msg): |
338 | 325 | index - index
|
339 |
| - with pytest.raises(err, match=msg): |
| 326 | + with pytest.raises(TypeError, match=msg): |
340 | 327 | index - index.tolist()
|
341 |
| - with pytest.raises(err, match=msg): |
| 328 | + with pytest.raises(TypeError, match=msg): |
342 | 329 | index.tolist() - index
|
343 | 330 |
|
344 | 331 | def test_sub_object(self):
|
|
0 commit comments