Skip to content

Commit 463611b

Browse files
committed
Add test to invalidate lenght one suffix parameter
1 parent 0cb6125 commit 463611b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/tests/reshape/merge/test_merge.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,13 +2088,16 @@ def test_merge_suffix_type_error(col1, col2, suffixes):
20882088

20892089

20902090
@pytest.mark.parametrize(
2091-
"col1, col2, suffixes", [("a", "a", ("a", "b", "c"))],
2091+
"col1, col2, suffixes, msg",
2092+
[
2093+
("a", "a", ("a", "b", "c"), r"too many values to unpack \(expected 2\)"),
2094+
("a", "a", ("a"), r"not enough values to unpack \(expected 2, got 1\)"),
2095+
],
20922096
)
2093-
def test_merge_suffix_length_error(col1, col2, suffixes):
2097+
def test_merge_suffix_length_error(col1, col2, suffixes, msg):
20942098
a = pd.DataFrame({col1: [1, 2, 3]})
20952099
b = pd.DataFrame({col2: [3, 4, 5]})
20962100

2097-
msg = r"too many values to unpack \(expected 2\)"
20982101
with pytest.raises(ValueError, match=msg):
20992102
pd.merge(a, b, left_index=True, right_index=True, suffixes=suffixes)
21002103

0 commit comments

Comments
 (0)