Skip to content

Commit 2edebf1

Browse files
committed
Index.intersection does not use safe_sort so adjust tests to reflect this
1 parent 97b0895 commit 2edebf1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/tests/indexes/test_base.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2257,12 +2257,14 @@ def test_intersection_base(self, sort):
22572257
if PY3 and sort:
22582258
# unorderable types
22592259
warn_type = RuntimeWarning
2260+
expected = Index([0, 'a', 1])
22602261
else:
22612262
warn_type = None
2263+
expected = Index([0, 1, 'a']) if sort else Index([0, 'a', 1])
22622264

22632265
with tm.assert_produces_warning(warn_type):
22642266
result = first.intersection(second, sort=sort)
2265-
expected = Index([0, 'a', 1])
2267+
22662268
tm.assert_index_equal(result, expected)
22672269

22682270
@pytest.mark.parametrize("klass", [

0 commit comments

Comments
 (0)