Skip to content

Commit beee346

Browse files
committed
TST: un-xfail string tests specific to object
1 parent 9bd4032 commit beee346

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pandas/tests/copy_view/test_interp_fillna.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
from pandas._config import using_string_dtype
5-
64
from pandas import (
75
NA,
86
DataFrame,
@@ -112,18 +110,18 @@ def test_interp_fill_functions_inplace(func, dtype):
112110
assert view._mgr._has_no_reference(0)
113111

114112

115-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
116113
def test_interpolate_cannot_with_object_dtype():
117114
df = DataFrame({"a": ["a", np.nan, "c"], "b": 1})
115+
df["a"] = df["a"].astype(object)
118116

119117
msg = "DataFrame cannot interpolate with object dtype"
120118
with pytest.raises(TypeError, match=msg):
121119
df.interpolate()
122120

123121

124-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
125122
def test_interpolate_object_convert_no_op():
126123
df = DataFrame({"a": ["a", "b", "c"], "b": 1})
124+
df["a"] = df["a"].astype(object)
127125
arr_a = get_array(df, "a")
128126

129127
# Now CoW makes a copy, it should not!

pandas/tests/copy_view/test_replace.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,9 @@ def test_replace_empty_list():
257257
assert not df2._mgr._has_no_reference(0)
258258

259259

260-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
261260
@pytest.mark.parametrize("value", ["d", None])
262261
def test_replace_object_list_inplace(value):
263-
df = DataFrame({"a": ["a", "b", "c"]})
262+
df = DataFrame({"a": ["a", "b", "c"]}, dtype=object)
264263
arr = get_array(df, "a")
265264
df.replace(["c"], value, inplace=True)
266265
assert np.shares_memory(arr, get_array(df, "a"))

0 commit comments

Comments
 (0)