@@ -43,24 +43,15 @@ def test_append_concat(self):
43
43
assert isinstance (result .index , PeriodIndex )
44
44
assert result .index [0 ] == s1 .index [0 ]
45
45
46
- def test_concat_copy (self , using_copy_on_write ):
46
+ def test_concat_copy (self ):
47
47
df = DataFrame (np .random .default_rng (2 ).standard_normal ((4 , 3 )))
48
48
df2 = DataFrame (np .random .default_rng (2 ).integers (0 , 10 , size = 4 ).reshape (4 , 1 ))
49
49
df3 = DataFrame ({5 : "foo" }, index = range (4 ))
50
50
51
51
# These are actual copies.
52
52
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
64
55
65
56
# These are the same.
66
57
result = concat ([df , df2 , df3 ], axis = 1 , copy = False )
@@ -78,15 +69,11 @@ def test_concat_copy(self, using_copy_on_write):
78
69
result = concat ([df , df2 , df3 , df4 ], axis = 1 , copy = False )
79
70
for arr in result ._mgr .arrays :
80
71
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
+ )
90
77
elif arr .dtype .kind in ["i" , "u" ]:
91
78
assert arr .base is df2 ._mgr .arrays [0 ].base
92
79
elif arr .dtype == object :
0 commit comments