Skip to content

Commit daf22e0

Browse files
add new test
1 parent 24d03bd commit daf22e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pandas/tests/reshape/merge/test_merge.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,11 +1451,18 @@ def test_merge_series(on, left_on, right_on, left_index, right_index, nm):
14511451
("a", 0, (None, "_y"), ["a", 0])
14521452
])
14531453
def test_merge_suffix(col1, col2, suffixes, expected_cols):
1454+
# 24819
14541455
a = pd.DataFrame({col1: [1, 2, 3]})
14551456
b = pd.DataFrame({col2: [4, 5, 6]})
14561457

14571458
df = a.merge(b, left_index=True, right_index=True, suffixes=suffixes)
14581459
assert df.columns.tolist() == expected_cols
14591460

1460-
with pytest.raises(ValueError):
1461+
1462+
def test_merge_suffix_errors():
1463+
# 24819
1464+
a = pd.DataFrame({0: [1, 2, 3]})
1465+
b = pd.DataFrame({0: [4, 5, 6]})
1466+
1467+
with pytest.raises(ValueError, match="columns overlap but no suffix specified"):
14611468
a.merge(b, left_index=True, right_index=True, suffixes=(None, None))

0 commit comments

Comments
 (0)