Skip to content

Commit 80217cf

Browse files
authored
Add test to check check_like with different indexes (pandas-dev#40872)
1 parent d999e82 commit 80217cf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/util/test_assert_frame_equal.py

+8
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,11 @@ def test_frame_equal_mixed_dtypes(frame_or_series, any_nullable_numeric_dtype, i
321321
msg = r'(Series|DataFrame.iloc\[:, 0\] \(column name="0"\) classes) are different'
322322
with pytest.raises(AssertionError, match=msg):
323323
tm.assert_equal(obj1, obj2, check_exact=True, check_dtype=False)
324+
325+
326+
def test_assert_series_equal_check_like_different_indexes():
327+
# GH#39739
328+
df1 = DataFrame(index=pd.Index([], dtype="object"))
329+
df2 = DataFrame(index=pd.RangeIndex(start=0, stop=0, step=1))
330+
with pytest.raises(AssertionError, match="DataFrame.index are different"):
331+
tm.assert_frame_equal(df1, df2, check_like=True)

0 commit comments

Comments
 (0)