We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5428c7a + 94ffa20 commit 22c60e8Copy full SHA for 22c60e8
1 file changed
tests/test_csv.py
@@ -5,6 +5,7 @@
5
"""
6
from pathlib import Path
7
from typing import List
8
+from csv import reader as csv_reader
9
10
11
def count_columns(file_name: Path) -> None:
@@ -15,14 +16,14 @@ def count_columns(file_name: Path) -> None:
15
16
expected_column_count: int = 0
17
18
with open(file_name, mode="r", encoding="utf-8") as my_file:
- for line in my_file:
19
-
+ my_csv = csv_reader(my_file)
20
+ for line in my_csv:
21
# All lines must match the header of the file:
22
if first_line:
23
first_line = False
- expected_column_count = len(line.split(","))
24
+ expected_column_count = len(line)
25
- assert expected_column_count == len(line.split(","))
26
+ assert expected_column_count == len(line)
27
28
def test_column_count() -> None:
29
0 commit comments