Skip to content

Commit

Permalink
Adding test for assert_equal_index with empty iterables (#29211)
Browse files Browse the repository at this point in the history
* Adding test for assert_equal_index with empty iterables

* Adding issue # in comment

* formatted file using black

* Move test to indexes/multi/test_constructor.py
  • Loading branch information
VijayantSoni authored and mroeschke committed Oct 29, 2019
1 parent c21235b commit 9c0f7c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pandas/tests/indexes/multi/test_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,3 +722,10 @@ def test_from_frame_invalid_names(names, expected_error_msg):
)
with pytest.raises(ValueError, match=expected_error_msg):
pd.MultiIndex.from_frame(df, names=names)


def test_index_equal_empty_iterable():
# #16844
a = MultiIndex(levels=[[], []], codes=[[], []], names=["a", "b"])
b = MultiIndex.from_arrays(arrays=[[], []], names=["a", "b"])
tm.assert_index_equal(a, b)

0 comments on commit 9c0f7c8

Please sign in to comment.