Skip to content

Commit 3bbac43

Browse files
committed
fix not using_infer_string build
1 parent a02cf70 commit 3bbac43

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pandas/tests/extension/test_string.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,14 @@ def test_loc_setitem_with_expansion_preserves_ea_index_dtype(
265265
request.applymarker(mark)
266266
super().test_loc_setitem_with_expansion_preserves_ea_index_dtype(data)
267267

268+
def test_loc_setitem_with_expansion_retains_ea_dtype(
269+
self, data, using_infer_string, request
270+
):
271+
if not using_infer_string and data.dtype.storage == "python":
272+
mark = pytest.mark.xfail(reason="Gives object")
273+
request.applymarker(mark)
274+
super().test_loc_setitem_with_expansion_retains_ea_dtype(data)
275+
268276

269277
class Test2DCompat(base.Dim2CompatTests):
270278
@pytest.fixture(autouse=True)

pandas/tests/series/indexing/test_setitem.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,10 @@ def test_setitem_enlargement_object_none(self, nulls_fixture, using_infer_string
601601
tm.assert_series_equal(ser, expected)
602602
if dtype == "str":
603603
ser[3] is np.nan
604-
else:
604+
elif using_infer_string:
605605
assert ser[3] is nulls_fixture
606+
else:
607+
assert type(ser[3]) is type(nulls_fixture)
606608

607609

608610
def test_setitem_scalar_into_readonly_backing_data():

0 commit comments

Comments
 (0)