Skip to content

Commit 3cf79ef

Browse files
committed
Fix tests
1 parent 1a8a897 commit 3cf79ef

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pandas/tests/frame/indexing/test_getitem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test_getitem_list_duplicates(self):
106106

107107
def test_getitem_dupe_cols(self):
108108
df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=["a", "a", "b"])
109-
msg = "\"None of [Index(['baf'], dtype=.*)] are in the [columns]\""
109+
msg = "\"None of [Index(['baf'], dtype="
110110
with pytest.raises(KeyError, match=re.escape(msg)):
111111
df[["baf"]]
112112

pandas/tests/frame/indexing/test_where.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,9 +1079,13 @@ def test_where_producing_ea_cond_for_np_dtype():
10791079
@pytest.mark.parametrize(
10801080
"replacement", [0.001, True, "snake", None, datetime(2022, 5, 4)]
10811081
)
1082-
def test_where_int_overflow(replacement):
1082+
def test_where_int_overflow(replacement, using_infer_string, request):
10831083
# GH 31687
10841084
df = DataFrame([[1.0, 2e25, "nine"], [np.nan, 0.1, None]])
1085+
if using_infer_string and replacement not in (None, "snake"):
1086+
request.node.add_marker(
1087+
pytest.mark.xfail(reason="Can't set non-string into string column")
1088+
)
10851089
result = df.where(pd.notnull(df), replacement)
10861090
expected = DataFrame([[1.0, 2e25, "nine"], [replacement, 0.1, replacement]])
10871091

0 commit comments

Comments
 (0)