Skip to content

Commit b9b1d25

Browse files
committed
use tm.shares_memory
1 parent aff3cd4 commit b9b1d25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/tests/arrays/categorical/test_astype.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ def test_astype_category_copy_false_nocopy_codes(self):
134134
# GH#62000
135135
cat = Categorical([3, 2, 4, 1])
136136
new = cat.astype("category", copy=False)
137-
assert new.codes.base is cat.codes.base or new.codes is cat.codes
137+
assert tm.shares_memory(new.codes, cat.codes)
138138
new = cat.astype("category", copy=True)
139-
assert not (new.codes.base is cat.codes.base or new.codes is cat.codes)
139+
assert not tm.shares_memory(new.codes, cat.codes)
140140

141141
def test_astype_object_datetime_categories(self):
142142
# GH#40754

0 commit comments

Comments
 (0)