Skip to content

Commit 2ab9d08

Browse files
committed
split test
1 parent f632526 commit 2ab9d08

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

pandas/tests/frame/test_constructors.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,14 +2080,6 @@ def test_constructor_series_copy(self, float_frame):
20802080

20812081
assert not (series["A"] == 5).all()
20822082

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-
20912083
def test_constructor_with_nas(self):
20922084
# GH 5016
20932085
# na's in indices
@@ -2876,3 +2868,13 @@ def test_tzaware_data_tznaive_dtype(self, constructor):
28762868

28772869
assert np.all(result.dtypes == "M8[ns]")
28782870
assert np.all(result == ts_naive)
2871+
2872+
def test_1d_object_array_does_not_copy(self):
2873+
a = np.array(["a", "b"], dtype="object")
2874+
df = DataFrame(a, copy=False)
2875+
assert np.shares_memory(df.values, a)
2876+
2877+
def test_2d_object_array_does_not_copy(self):
2878+
b = np.array([["a", "b"], ["c", "d"]], dtype="object")
2879+
df2 = DataFrame(b, copy=False)
2880+
assert np.shares_memory(df2.values, b)

0 commit comments

Comments
 (0)