Skip to content

Commit b85d131

Browse files
committed
Index.intersection does not use safe_sort so adjust tests to reflect this
1 parent a9158bb commit b85d131

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
@@ -2359,12 +2359,14 @@ def test_intersection_base(self, sort):
23592359
if PY3 and sort:
23602360
# unorderable types
23612361
warn_type = RuntimeWarning
2362+
expected = Index([0, 'a', 1])
23622363
else:
23632364
warn_type = None
2365+
expected = Index([0, 1, 'a']) if sort else Index([0, 'a', 1])
23642366

23652367
with tm.assert_produces_warning(warn_type):
23662368
result = first.intersection(second, sort=sort)
2367-
expected = Index([0, 'a', 1])
2369+
23682370
tm.assert_index_equal(result, expected)
23692371

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

0 commit comments

Comments
 (0)