Skip to content

Commit b002e38

Browse files
correct test to work without CoW
1 parent a2a1a91 commit b002e38

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/tests/copy_view/test_replace.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,10 @@ def test_replace_list_none(using_copy_on_write):
388388
# https://github.com/pandas-dev/pandas/issues/59770
389389
df3 = df.replace(["d", "e", "f"], value=None)
390390
tm.assert_frame_equal(df3, df_orig)
391-
assert tm.shares_memory(get_array(df, "a"), get_array(df3, "a"))
391+
if using_copy_on_write:
392+
assert tm.shares_memory(get_array(df, "a"), get_array(df3, "a"))
393+
else:
394+
assert not tm.shares_memory(get_array(df, "a"), get_array(df3, "a"))
392395

393396

394397
def test_replace_list_none_inplace_refs(using_copy_on_write, warn_copy_on_write):

0 commit comments

Comments
 (0)