@@ -1173,9 +1173,7 @@ def test_assignment_single_assign_new(self):
1173
1173
df .eval ("c = a + b" , inplace = True )
1174
1174
tm .assert_frame_equal (df , expected )
1175
1175
1176
- # TODO(CoW-warn) this should not warn (DataFrame.eval creates refs to self)
1177
- @pytest .mark .filterwarnings ("ignore:Setting a value on a view:FutureWarning" )
1178
- def test_assignment_single_assign_local_overlap (self , warn_copy_on_write ):
1176
+ def test_assignment_single_assign_local_overlap (self ):
1179
1177
df = DataFrame (
1180
1178
np .random .default_rng (2 ).standard_normal ((5 , 2 )), columns = list ("ab" )
1181
1179
)
@@ -1229,8 +1227,6 @@ def test_column_in(self):
1229
1227
tm .assert_series_equal (result , expected , check_names = False )
1230
1228
1231
1229
@pytest .mark .xfail (reason = "Unknown: Omitted test_ in name prior." )
1232
- # TODO(CoW-warn) this should not warn (DataFrame.eval creates refs to self)
1233
- @pytest .mark .filterwarnings ("ignore:Setting a value on a view:FutureWarning" )
1234
1230
def test_assignment_not_inplace (self ):
1235
1231
# see gh-9297
1236
1232
df = DataFrame (
@@ -1244,7 +1240,7 @@ def test_assignment_not_inplace(self):
1244
1240
expected ["c" ] = expected ["a" ] + expected ["b" ]
1245
1241
tm .assert_frame_equal (df , expected )
1246
1242
1247
- def test_multi_line_expression (self ):
1243
+ def test_multi_line_expression (self , warn_copy_on_write ):
1248
1244
# GH 11149
1249
1245
df = DataFrame ({"a" : [1 , 2 , 3 ], "b" : [4 , 5 , 6 ]})
1250
1246
expected = df .copy ()
@@ -1917,8 +1913,8 @@ def test_set_inplace(using_copy_on_write, warn_copy_on_write):
1917
1913
df = DataFrame ({"A" : [1 , 2 , 3 ], "B" : [4 , 5 , 6 ], "C" : [7 , 8 , 9 ]})
1918
1914
result_view = df [:]
1919
1915
ser = df ["A" ]
1920
- # with tm.assert_cow_warning(warn_copy_on_write):
1921
- df .eval ("A = B + C" , inplace = True )
1916
+ with tm .assert_cow_warning (warn_copy_on_write ):
1917
+ df .eval ("A = B + C" , inplace = True )
1922
1918
expected = DataFrame ({"A" : [11 , 13 , 15 ], "B" : [4 , 5 , 6 ], "C" : [7 , 8 , 9 ]})
1923
1919
tm .assert_frame_equal (df , expected )
1924
1920
if not using_copy_on_write :
0 commit comments