Skip to content

Commit ff3472b

Browse files
committed
Add unit tests for tm.shares_memory (#55372)
1 parent a0769ff commit ff3472b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/tests/util/test_shares_memory.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ def test_shares_memory_numpy():
4444
def test_shares_memory_series():
4545
arr = np.arange(10)
4646
s = pd.Series(arr)
47-
assert tm.shares_memory(arr, s)
47+
assert tm.shares_memory(s, arr)
4848
s2 = pd.Series(np.arange(10))
4949
assert not tm.shares_memory(s, s2)
5050

5151

5252
def test_shares_memory_dataframe_single_block():
5353
arr = np.arange(10)
5454
df = pd.DataFrame({"a": arr})
55-
assert tm.shares_memory(arr, df)
55+
assert tm.shares_memory(df, arr)
5656
df2 = pd.DataFrame({"a": np.arange(10)})
5757
assert not tm.shares_memory(df, df2)
5858

@@ -65,7 +65,5 @@ def test_shares_memory_rangeindex():
6565

6666
def test_shares_memory_multiindex():
6767
idx = pd.MultiIndex.from_arrays([np.arange(10), np.arange(10, 20)])
68-
arr = idx.codes[0]
69-
assert tm.shares_memory(idx, arr)
7068
arr2 = np.arange(10)
7169
assert not tm.shares_memory(idx, arr2)

0 commit comments

Comments
 (0)