Skip to content

Commit 6bdc2ec

Browse files
committed
wip enforce pdep6
1 parent 3d5116c commit 6bdc2ec

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pandas/tests/copy_view/test_indexing.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -725,16 +725,15 @@ def test_column_as_series_set_with_upcast(backend):
725725
with pytest.raises(TypeError, match="Invalid value"):
726726
s[0] = "foo"
727727
expected = Series([1, 2, 3], name="a")
728+
tm.assert_series_equal(s, expected)
729+
tm.assert_frame_equal(df, df_orig)
730+
# ensure cached series on getitem is not the changed series
731+
tm.assert_series_equal(df["a"], df_orig["a"])
728732
else:
729733
with pytest.raises(TypeError, match="Invalid value"):
730734
s[0] = "foo"
731735
return
732736

733-
tm.assert_series_equal(s, expected)
734-
tm.assert_frame_equal(df, df_orig)
735-
# ensure cached series on getitem is not the changed series
736-
tm.assert_series_equal(df["a"], df_orig["a"])
737-
738737

739738
@pytest.mark.parametrize(
740739
"method",

pandas/tests/indexing/multiindex/test_setitem.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ def test_multiindex_assignment_single_dtype(self):
215215
# arr + 0.5 cannot be cast losslessly to int, so we upcast
216216
with pytest.raises(TypeError, match="Invalid value"):
217217
df.loc[4, "c"] = arr + 0.5
218+
df = df.astype({"c": "float64"})
219+
df.loc[4, "c"] = arr + 0.5
218220

219221
# scalar ok
220222
df.loc[4, "c"] = 10

0 commit comments

Comments
 (0)