Skip to content

Commit 227b42a

Browse files
fix test_sub_fail for infer_string
1 parent ff1f57e commit 227b42a

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

pandas/tests/arithmetic/test_object.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import numpy as np
99
import pytest
1010

11-
from pandas._config import using_string_dtype
12-
13-
from pandas.compat import HAS_PYARROW
1411
import pandas.util._test_decorators as td
1512

1613
import pandas as pd
@@ -318,27 +315,17 @@ def test_add(self):
318315
expected = pd.Index(["1a", "1b", "1c"])
319316
tm.assert_index_equal("1" + index, expected)
320317

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):
325319
index = pd.Index([str(i) for i in range(10)])
326320

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):
336323
index - "a"
337-
with pytest.raises(err, match=msg):
324+
with pytest.raises(TypeError, match=msg):
338325
index - index
339-
with pytest.raises(err, match=msg):
326+
with pytest.raises(TypeError, match=msg):
340327
index - index.tolist()
341-
with pytest.raises(err, match=msg):
328+
with pytest.raises(TypeError, match=msg):
342329
index.tolist() - index
343330

344331
def test_sub_object(self):

0 commit comments

Comments
 (0)