Skip to content

Commit d234a1d

Browse files
fix linting + catch remaining RuntimeWarning
1 parent 32a5966 commit d234a1d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pandas/tests/indexes/multi/test_set_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ def test_intersection(idx, sort):
287287

288288
def test_intersect_equal_sort():
289289
idx = pd.MultiIndex.from_product([[1, 0], ['a', 'b']])
290-
sorted_ = pd.MultiIndex.from_product([[0, 1], ['a', 'b']])
290+
# sorted_ = pd.MultiIndex.from_product([[0, 1], ['a', 'b']])
291291
tm.assert_index_equal(idx.intersection(idx, sort=False), idx)
292292
tm.assert_index_equal(idx.intersection(idx, sort=None), idx)
293+
# TODO decide on True behaviour
293294
# tm.assert_index_equal(idx.intersection(idx, sort=True), sorted_)
294295

295296

pandas/tests/indexes/test_base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,14 +830,15 @@ def test_union_sort_other_special(self, slice_):
830830
def test_union_sort_other_incomparable(self):
831831
# https://github.com/pandas-dev/pandas/issues/24959
832832
idx = pd.Index([1, pd.Timestamp('2000')])
833-
# default, sort=None
833+
# default (sort=None)
834834
with tm.assert_produces_warning(RuntimeWarning):
835835
result = idx.union(idx[:1])
836836

837837
tm.assert_index_equal(result, idx)
838838

839-
# sort=False
840-
result = idx.union(idx[:1], sort=None)
839+
# sort=None
840+
with tm.assert_produces_warning(RuntimeWarning):
841+
result = idx.union(idx[:1], sort=None)
841842
tm.assert_index_equal(result, idx)
842843

843844
# TODO decide on True behaviour

0 commit comments

Comments
 (0)