Skip to content

Commit d466e24

Browse files
committed
replace ValueError assertion with FutureWarning when copy=False
1 parent 1820f78 commit d466e24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/copy_view/test_array.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def test_dataframe_multiple_numpy_dtypes():
187187
if np_version_gt2:
188188
# copy=False semantics are only supported in NumPy>=2.
189189

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

193194
arr = np.array(df, copy=True)

0 commit comments

Comments
 (0)