Skip to content

Commit 6de9af1

Browse files
Removed an unnecessary part of the test.
1 parent b0ddd3e commit 6de9af1

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

pandas/tests/io/parser/test_common.py

+4-13
Original file line numberDiff line numberDiff line change
@@ -2137,20 +2137,11 @@ def test_no_header_two_extra_columns(all_parsers):
21372137
tm.assert_frame_equal(df, ref)
21382138

21392139

2140-
def test_read_csv_names_types(all_parsers):
2140+
def test_read_csv_names_not_accepting_sets(all_parsers):
21412141
# GH 34946
21422142
data = """\
21432143
1,2,3
2144-
4,5,6
2145-
7,8,9
2146-
10,11,12\n"""
2144+
4,5,6\n"""
21472145
parser = all_parsers
2148-
msg = "Names should be an ordered collection."
2149-
names = "QAZ"
2150-
with pytest.raises(ValueError, match=msg):
2151-
parser.read_csv(StringIO(data), names=set(names))
2152-
2153-
ref = DataFrame(data={"Q": [1, 4, 7, 10], "A": [2, 5, 8, 11], "Z": [3, 6, 9, 12]})
2154-
for valid_type_converter in (list, tuple):
2155-
df = parser.read_csv(StringIO(data), names=valid_type_converter(names))
2156-
tm.assert_frame_equal(df, ref)
2146+
with pytest.raises(ValueError, match="Names should be an ordered collection."):
2147+
parser.read_csv(StringIO(data), names=set("QAZ"))

0 commit comments

Comments
 (0)