@@ -43,24 +43,15 @@ def test_append_concat(self):
4343 assert isinstance (result .index , PeriodIndex )
4444 assert result .index [0 ] == s1 .index [0 ]
4545
46- def test_concat_copy (self , using_copy_on_write ):
46+ def test_concat_copy (self ):
4747 df = DataFrame (np .random .default_rng (2 ).standard_normal ((4 , 3 )))
4848 df2 = DataFrame (np .random .default_rng (2 ).integers (0 , 10 , size = 4 ).reshape (4 , 1 ))
4949 df3 = DataFrame ({5 : "foo" }, index = range (4 ))
5050
5151 # These are actual copies.
5252 result = concat ([df , df2 , df3 ], axis = 1 , copy = True )
53-
54- if not using_copy_on_write :
55- for arr in result ._mgr .arrays :
56- assert not any (
57- np .shares_memory (arr , y )
58- for x in [df , df2 , df3 ]
59- for y in x ._mgr .arrays
60- )
61- else :
62- for arr in result ._mgr .arrays :
63- assert arr .base is not None
53+ for arr in result ._mgr .arrays :
54+ assert arr .base is not None
6455
6556 # These are the same.
6657 result = concat ([df , df2 , df3 ], axis = 1 , copy = False )
@@ -78,15 +69,11 @@ def test_concat_copy(self, using_copy_on_write):
7869 result = concat ([df , df2 , df3 , df4 ], axis = 1 , copy = False )
7970 for arr in result ._mgr .arrays :
8071 if arr .dtype .kind == "f" :
81- if using_copy_on_write :
82- # this is a view on some array in either df or df4
83- assert any (
84- np .shares_memory (arr , other )
85- for other in df ._mgr .arrays + df4 ._mgr .arrays
86- )
87- else :
88- # the block was consolidated, so we got a copy anyway
89- assert arr .base is None
72+ # this is a view on some array in either df or df4
73+ assert any (
74+ np .shares_memory (arr , other )
75+ for other in df ._mgr .arrays + df4 ._mgr .arrays
76+ )
9077 elif arr .dtype .kind in ["i" , "u" ]:
9178 assert arr .base is df2 ._mgr .arrays [0 ].base
9279 elif arr .dtype == object :
0 commit comments