Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl committed Dec 8, 2023
1 parent 1427251 commit 77f7aa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ def warn_copy_on_write() -> bool:
"""
Fixture to check if Copy-on-Write is enabled.
"""
pd.options.mode.copy_on_write = "warn"
return (
pd.options.mode.copy_on_write == "warn"
and _get_option("mode.data_manager", silent=True) == "block"
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/copy_view/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,13 +1145,12 @@ def test_set_value_copy_only_necessary_column(
view = df[:]

if val == "a" and indexer[0] != slice(None):
# TODO(CoW-warn) assert the FutureWarning for CoW is also raised
with tm.assert_produces_warning(
FutureWarning, match="Setting an item of incompatible dtype is deprecated"
):
indexer_func(df)[indexer] = val
else:
with tm.assert_cow_warning(warn_copy_on_write):
with tm.assert_cow_warning(warn_copy_on_write and val == 100):
indexer_func(df)[indexer] = val

if using_copy_on_write:
Expand Down

0 comments on commit 77f7aa4

Please sign in to comment.