Skip to content

Commit 5d5d668

Browse files
committed
TST: Add test for CategoricalIndex vs Index in assert_index_equal
1 parent f9f62a3 commit 5d5d668

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/tests/util/test_assert_index_equal.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ def test_assert_multi_index_dtype_check_categorical(check_categorical):
321321

322322
def test_assert_index_equal_categorical_mismatch_categories():
323323
# GH#61941
324-
ci1 = CategoricalIndex(["a", "b", "c"], categories=["a", "b", "c"], ordered=False)
325-
ci2 = CategoricalIndex(["a", "x", "c"], categories=["a", "b", "c"], ordered=False)
324+
ci = CategoricalIndex(["a", "b", "c"], categories=["a", "b", "c"], ordered=False)
325+
idx = Index(["a", "b", "c"])
326326

327327
with pytest.raises(AssertionError, match="Index are different"):
328-
tm.assert_index_equal(ci1, ci2, check_exact=False, check_categorical=True)
328+
tm.assert_index_equal(
329+
ci,
330+
idx,
331+
)

0 commit comments

Comments
 (0)