Skip to content

Commit 0820752

Browse files
committedFeb 24, 2025
fix the type check error in the pipeline checks
1 parent ec96941 commit 0820752

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎mypy/test/testconfigparser.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from mypy.config_parser import parse_config_file
66

77
class TestConfigParser(TestCase):
8-
def test_parse_config_file_with_single_file(self):
8+
def test_parse_config_file_with_single_file(self) -> None:
99
"""A single file should be correctly parsed."""
1010
with tempfile.TemporaryDirectory() as tmpdirname:
1111
config_path = os.path.join(tmpdirname, "test_config.ini")
@@ -30,7 +30,7 @@ def test_parse_config_file_with_single_file(self):
3030

3131
self.assertEqual(options.files, ["file1.py"])
3232

33-
def test_parse_config_file_with_no_spaces(self):
33+
def test_parse_config_file_with_no_spaces(self) -> None:
3434
"""Files listed without spaces should be correctly parsed."""
3535
with tempfile.TemporaryDirectory() as tmpdirname:
3636
config_path = os.path.join(tmpdirname, "test_config.ini")
@@ -55,7 +55,7 @@ def test_parse_config_file_with_no_spaces(self):
5555

5656
self.assertEqual(options.files, ["file1.py", "file2.py", "file3.py"])
5757

58-
def test_parse_config_file_with_extra_spaces(self):
58+
def test_parse_config_file_with_extra_spaces(self) -> None:
5959
"""Files with extra spaces should be correctly parsed."""
6060
with tempfile.TemporaryDirectory() as tmpdirname:
6161
config_path = os.path.join(tmpdirname, "test_config.ini")
@@ -80,7 +80,7 @@ def test_parse_config_file_with_extra_spaces(self):
8080

8181
self.assertEqual(options.files, ["file1.py", "file2.py", "file3.py"])
8282

83-
def test_parse_config_file_with_empty_files_key(self):
83+
def test_parse_config_file_with_empty_files_key(self) -> None:
8484
"""An empty files key should result in an empty list."""
8585
with tempfile.TemporaryDirectory() as tmpdirname:
8686
config_path = os.path.join(tmpdirname, "test_config.ini")
@@ -105,7 +105,7 @@ def test_parse_config_file_with_empty_files_key(self):
105105

106106
self.assertEqual(options.files, [])
107107

108-
def test_parse_config_file_with_only_comma(self):
108+
def test_parse_config_file_with_only_comma(self) -> None:
109109
"""A files key with only a comma should raise an error."""
110110
with tempfile.TemporaryDirectory() as tmpdirname:
111111
config_path = os.path.join(tmpdirname, "test_config.ini")
@@ -131,7 +131,7 @@ def test_parse_config_file_with_only_comma(self):
131131

132132
self.assertIn("Invalid config", str(cm.exception))
133133

134-
def test_parse_config_file_with_only_whitespace(self):
134+
def test_parse_config_file_with_only_whitespace(self) -> None:
135135
"""A files key with only whitespace should result in an empty list."""
136136
with tempfile.TemporaryDirectory() as tmpdirname:
137137
config_path = os.path.join(tmpdirname, "test_config.ini")
@@ -156,7 +156,7 @@ def test_parse_config_file_with_only_whitespace(self):
156156

157157
self.assertEqual(options.files, [])
158158

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:
160160
"""Mix of valid and invalid filenames should raise an error."""
161161
with tempfile.TemporaryDirectory() as tmpdirname:
162162
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):
182182

183183
self.assertIn("Invalid config", str(cm.exception))
184184

185-
def test_parse_config_file_with_newlines_between_files(self):
185+
def test_parse_config_file_with_newlines_between_files(self) -> None:
186186
"""Newlines between file entries should be correctly handled."""
187187
with tempfile.TemporaryDirectory() as tmpdirname:
188188
config_path = os.path.join(tmpdirname, "test_config.ini")

0 commit comments

Comments
 (0)