Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pandas/tests/util/test_assert_index_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pytest

from pandas import (
NA,
Categorical,
CategoricalIndex,
Index,
Expand Down Expand Up @@ -238,6 +239,21 @@ def test_index_equal_range_categories(check_categorical, exact):
)


def test_assert_index_equal_different_inferred_types():
# GH#31884
msg = """\
Index are different

Attribute "inferred_type" are different
\\[left\\]: mixed
\\[right\\]: datetime"""

idx1 = Index([NA, np.datetime64("nat")])
idx2 = Index([NA, NaT])
with pytest.raises(AssertionError, match=msg):
tm.assert_index_equal(idx1, idx2)


def test_assert_index_equal_different_names_check_order_false():
# GH#47328
idx1 = Index([1, 3], name="a")
Expand Down