@@ -117,49 +117,50 @@ def from_csv(
117
117
"""Create an OutputLine from a comma separated list (the functional tests expected
118
118
output .txt files).
119
119
"""
120
+ if isinstance (row , str ):
121
+ row = row .split ("," )
120
122
try :
121
- if isinstance (row , Sequence ):
122
- column = cls ._get_column (row [2 ])
123
- if len (row ) == 5 :
124
- warnings .warn (
125
- "In pylint 3.0 functional tests expected output should always include the "
126
- "expected confidence level, expected end_line and expected end_column. "
127
- "An OutputLine should thus have a length of 8." ,
128
- DeprecationWarning ,
129
- )
130
- return cls (
131
- row [0 ],
132
- int (row [1 ]),
133
- column ,
134
- None ,
135
- None ,
136
- row [3 ],
137
- row [4 ],
138
- UNDEFINED .name ,
139
- )
140
- if len (row ) == 6 :
141
- warnings .warn (
142
- "In pylint 3.0 functional tests expected output should always include the "
143
- "expected end_line and expected end_column. An OutputLine should thus have "
144
- "a length of 8." ,
145
- DeprecationWarning ,
146
- )
147
- return cls (
148
- row [0 ], int (row [1 ]), column , None , None , row [3 ], row [4 ], row [5 ]
149
- )
150
- if len (row ) == 8 :
151
- end_line = cls ._get_py38_none_value (row [3 ], check_endline )
152
- end_column = cls ._get_py38_none_value (row [4 ], check_endline )
153
- return cls (
154
- row [0 ],
155
- int (row [1 ]),
156
- column ,
157
- cls ._value_to_optional_int (end_line ),
158
- cls ._value_to_optional_int (end_column ),
159
- row [5 ],
160
- row [6 ],
161
- row [7 ],
162
- )
123
+ column = cls ._get_column (row [2 ])
124
+ if len (row ) == 5 :
125
+ warnings .warn (
126
+ "In pylint 3.0 functional tests expected output should always include the "
127
+ "expected confidence level, expected end_line and expected end_column. "
128
+ "An OutputLine should thus have a length of 8." ,
129
+ DeprecationWarning ,
130
+ )
131
+ return cls (
132
+ row [0 ],
133
+ int (row [1 ]),
134
+ column ,
135
+ None ,
136
+ None ,
137
+ row [3 ],
138
+ row [4 ],
139
+ UNDEFINED .name ,
140
+ )
141
+ if len (row ) == 6 :
142
+ warnings .warn (
143
+ "In pylint 3.0 functional tests expected output should always include the "
144
+ "expected end_line and expected end_column. An OutputLine should thus have "
145
+ "a length of 8." ,
146
+ DeprecationWarning ,
147
+ )
148
+ return cls (
149
+ row [0 ], int (row [1 ]), column , None , None , row [3 ], row [4 ], row [5 ]
150
+ )
151
+ if len (row ) == 8 :
152
+ end_line = cls ._get_py38_none_value (row [3 ], check_endline )
153
+ end_column = cls ._get_py38_none_value (row [4 ], check_endline )
154
+ return cls (
155
+ row [0 ],
156
+ int (row [1 ]),
157
+ column ,
158
+ cls ._value_to_optional_int (end_line ),
159
+ cls ._value_to_optional_int (end_column ),
160
+ row [5 ],
161
+ row [6 ],
162
+ row [7 ],
163
+ )
163
164
raise IndexError
164
165
except Exception as e :
165
166
raise MalformedOutputLineException (row , e ) from e
0 commit comments