File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 55"""
66from pathlib import Path
77from typing import List
8+ from csv import reader as csv_reader
89
910
1011def count_columns (file_name : Path ) -> None :
@@ -15,14 +16,14 @@ def count_columns(file_name: Path) -> None:
1516 expected_column_count : int = 0
1617
1718 with open (file_name , mode = "r" , encoding = "utf-8" ) as my_file :
18- for line in my_file :
19-
19+ my_csv = csv_reader ( my_file )
20+ for line in my_csv :
2021 # All lines must match the header of the file:
2122 if first_line :
2223 first_line = False
23- expected_column_count = len (line . split ( "," ) )
24+ expected_column_count = len (line )
2425
25- assert expected_column_count == len (line . split ( "," ) )
26+ assert expected_column_count == len (line )
2627
2728def test_column_count () -> None :
2829 """
You can’t perform that action at this time.
0 commit comments