Skip to content

Commit

Permalink
replace ValueError assertion with FutureWarning when copy=False
Browse files Browse the repository at this point in the history
  • Loading branch information
KevsterAmp committed Dec 19, 2024
1 parent 1820f78 commit d466e24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pandas/tests/copy_view/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ def test_dataframe_multiple_numpy_dtypes():
if np_version_gt2:
# copy=False semantics are only supported in NumPy>=2.

with pytest.raises(ValueError, match="Unable to avoid copy while creating"):
msg = "Starting with NumPy 2.0, the behavior of the 'copy' keyword has changed"
with pytest.raises(FutureWarning, match=msg):
arr = np.array(df, copy=False)

arr = np.array(df, copy=True)
Expand Down

0 comments on commit d466e24

Please sign in to comment.