Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl committed Nov 25, 2023
1 parent 9b30bdd commit 8585bd7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pandas/tests/indexing/test_chaining_and_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ def test_setitem_chained_setfault(self, using_copy_on_write, warn_copy_on_write)
df.response[mask] = "none"
tm.assert_frame_equal(df, DataFrame({"response": data}))
else:
# TODO(CoW-warn) should warn
# with tm.assert_cow_warning(warn_copy_on_write):
df.response[mask] = "none"
with tm.assert_cow_warning(warn_copy_on_write):
df.response[mask] = "none"
tm.assert_frame_equal(df, DataFrame({"response": mdata}))

df = DataFrame({"response": data, "response1": data})
Expand All @@ -189,9 +188,8 @@ def test_setitem_chained_setfault(self, using_copy_on_write, warn_copy_on_write)
df.response[mask] = "none"
tm.assert_frame_equal(df, df_original)
else:
# TODO(CoW-warn) should warn
# with tm.assert_cow_warning(warn_copy_on_write):
df.response[mask] = "none"
with tm.assert_cow_warning(warn_copy_on_write):
df.response[mask] = "none"
tm.assert_frame_equal(df, DataFrame({"response": mdata, "response1": data}))

# GH 6056
Expand All @@ -202,7 +200,6 @@ def test_setitem_chained_setfault(self, using_copy_on_write, warn_copy_on_write)
df["A"].iloc[0] = np.nan
expected = DataFrame({"A": ["foo", "bar", "bah", "foo", "bar"]})
else:
# TODO(CoW-warn) custom warning message
with tm.assert_cow_warning(warn_copy_on_write):
df["A"].iloc[0] = np.nan
expected = DataFrame({"A": [np.nan, "bar", "bah", "foo", "bar"]})
Expand Down

0 comments on commit 8585bd7

Please sign in to comment.