Skip to content

Commit 03b6e06

Browse files
committed
TST: Add test for duplcated columns and usecols GH#11823
Signed-off-by: Liang Yan <[email protected]>
1 parent d06f2d3 commit 03b6e06

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/io/parser/test_mangle_dupes.py

+11
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,14 @@ def test_mangle_dupe_cols_already_exists_unnamed_col(all_parsers):
163163
columns=["Unnamed: 0.1", "Unnamed: 0", "Unnamed: 2.1", "Unnamed: 2"],
164164
)
165165
tm.assert_frame_equal(result, expected)
166+
167+
168+
@skip_pyarrow
169+
@pytest.mark.parametrize("usecol, engine", [([0, 1, 1], "python"), ([0, 1, 1], "c")])
170+
def test_mangle_cols_names(all_parsers, usecol, engine):
171+
# GH 11823
172+
parser = all_parsers
173+
data = "1,2,3"
174+
names = ["A", "A", "B"]
175+
with pytest.raises(ValueError, match="Duplicate names"):
176+
parser.read_csv(StringIO(data), names=names, usecols=usecol, engine=engine)

0 commit comments

Comments
 (0)