Skip to content

Commit ac71b7d

Browse files
committed
split test
1 parent f632526 commit ac71b7d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

pandas/tests/frame/test_constructors.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,18 @@ def test_constructor_dtype_nocast_view_2d_array(self):
253253
should_be_view[0][0] = 97
254254
assert df.values[0, 0] == 97
255255

256+
@td.skip_array_manager_invalid_test
257+
def test_1d_object_array_does_not_copy(self):
258+
arr = np.array(["a", "b"], dtype="object")
259+
df = DataFrame(arr)
260+
assert np.shares_memory(df.values, arr)
261+
262+
@td.skip_array_manager_invalid_test
263+
def test_2d_object_array_does_not_copy(self):
264+
arr = np.array([["a", "b"], ["c", "d"]], dtype="object")
265+
df = DataFrame(arr)
266+
assert np.shares_memory(df.values, arr)
267+
256268
def test_constructor_dtype_list_data(self):
257269
df = DataFrame([[1, "2"], [None, "a"]], dtype=object)
258270
assert df.loc[1, 0] is None
@@ -2080,14 +2092,6 @@ def test_constructor_series_copy(self, float_frame):
20802092

20812093
assert not (series["A"] == 5).all()
20822094

2083-
def test_object_array_does_not_copy(self):
2084-
a = np.array(["a", "b"], dtype="object")
2085-
b = np.array([["a", "b"], ["c", "d"]], dtype="object")
2086-
df = DataFrame(a)
2087-
assert np.shares_memory(df.values, a)
2088-
df2 = DataFrame(b)
2089-
assert np.shares_memory(df2.values, b)
2090-
20912095
def test_constructor_with_nas(self):
20922096
# GH 5016
20932097
# na's in indices

0 commit comments

Comments
 (0)