5
5
from mypy .config_parser import parse_config_file
6
6
7
7
class TestConfigParser (TestCase ):
8
- def test_parse_config_file_with_single_file (self ):
8
+ def test_parse_config_file_with_single_file (self ) -> None :
9
9
"""A single file should be correctly parsed."""
10
10
with tempfile .TemporaryDirectory () as tmpdirname :
11
11
config_path = os .path .join (tmpdirname , "test_config.ini" )
@@ -30,7 +30,7 @@ def test_parse_config_file_with_single_file(self):
30
30
31
31
self .assertEqual (options .files , ["file1.py" ])
32
32
33
- def test_parse_config_file_with_no_spaces (self ):
33
+ def test_parse_config_file_with_no_spaces (self ) -> None :
34
34
"""Files listed without spaces should be correctly parsed."""
35
35
with tempfile .TemporaryDirectory () as tmpdirname :
36
36
config_path = os .path .join (tmpdirname , "test_config.ini" )
@@ -55,7 +55,7 @@ def test_parse_config_file_with_no_spaces(self):
55
55
56
56
self .assertEqual (options .files , ["file1.py" , "file2.py" , "file3.py" ])
57
57
58
- def test_parse_config_file_with_extra_spaces (self ):
58
+ def test_parse_config_file_with_extra_spaces (self ) -> None :
59
59
"""Files with extra spaces should be correctly parsed."""
60
60
with tempfile .TemporaryDirectory () as tmpdirname :
61
61
config_path = os .path .join (tmpdirname , "test_config.ini" )
@@ -80,7 +80,7 @@ def test_parse_config_file_with_extra_spaces(self):
80
80
81
81
self .assertEqual (options .files , ["file1.py" , "file2.py" , "file3.py" ])
82
82
83
- def test_parse_config_file_with_empty_files_key (self ):
83
+ def test_parse_config_file_with_empty_files_key (self ) -> None :
84
84
"""An empty files key should result in an empty list."""
85
85
with tempfile .TemporaryDirectory () as tmpdirname :
86
86
config_path = os .path .join (tmpdirname , "test_config.ini" )
@@ -105,7 +105,7 @@ def test_parse_config_file_with_empty_files_key(self):
105
105
106
106
self .assertEqual (options .files , [])
107
107
108
- def test_parse_config_file_with_only_comma (self ):
108
+ def test_parse_config_file_with_only_comma (self ) -> None :
109
109
"""A files key with only a comma should raise an error."""
110
110
with tempfile .TemporaryDirectory () as tmpdirname :
111
111
config_path = os .path .join (tmpdirname , "test_config.ini" )
@@ -131,7 +131,7 @@ def test_parse_config_file_with_only_comma(self):
131
131
132
132
self .assertIn ("Invalid config" , str (cm .exception ))
133
133
134
- def test_parse_config_file_with_only_whitespace (self ):
134
+ def test_parse_config_file_with_only_whitespace (self ) -> None :
135
135
"""A files key with only whitespace should result in an empty list."""
136
136
with tempfile .TemporaryDirectory () as tmpdirname :
137
137
config_path = os .path .join (tmpdirname , "test_config.ini" )
@@ -156,7 +156,7 @@ def test_parse_config_file_with_only_whitespace(self):
156
156
157
157
self .assertEqual (options .files , [])
158
158
159
- def test_parse_config_file_with_mixed_valid_and_invalid_entries (self ):
159
+ def test_parse_config_file_with_mixed_valid_and_invalid_entries (self ) -> None :
160
160
"""Mix of valid and invalid filenames should raise an error."""
161
161
with tempfile .TemporaryDirectory () as tmpdirname :
162
162
config_path = os .path .join (tmpdirname , "test_config.ini" )
@@ -182,7 +182,7 @@ def test_parse_config_file_with_mixed_valid_and_invalid_entries(self):
182
182
183
183
self .assertIn ("Invalid config" , str (cm .exception ))
184
184
185
- def test_parse_config_file_with_newlines_between_files (self ):
185
+ def test_parse_config_file_with_newlines_between_files (self ) -> None :
186
186
"""Newlines between file entries should be correctly handled."""
187
187
with tempfile .TemporaryDirectory () as tmpdirname :
188
188
config_path = os .path .join (tmpdirname , "test_config.ini" )
0 commit comments