Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pandas/tests/copy_view/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)
import pandas._testing as tm
from pandas.tests.copy_view.util import get_array
from pandas.util.version import Version


def test_copy():
Expand Down Expand Up @@ -917,8 +918,9 @@ def test_round(decimals):

assert tm.shares_memory(get_array(df2, "b"), get_array(df, "b"))
# TODO: Make inplace by using out parameter of ndarray.round?
if decimals >= 0:
if decimals >= 0 and Version(np.__version__) < Version("2.4.0.dev0"):
# Ensure lazy copy if no-op
# TODO: Cannot rely on Numpy returning view after version 2.3
assert np.shares_memory(get_array(df2, "a"), get_array(df, "a"))
else:
assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a"))
Expand Down
Loading