20
20
warnfile = StringIO ()
21
21
22
22
23
- def setup_module ():
23
+ def setup_module () -> None :
24
24
disable_colour ()
25
25
26
26
@@ -48,7 +48,7 @@ def input_(prompt: str) -> str:
48
48
real_input : Callable [[str ], str ] = input
49
49
50
50
51
- def teardown_module ():
51
+ def teardown_module () -> None :
52
52
qs .term_input = real_input
53
53
enable_colour ()
54
54
@@ -61,7 +61,7 @@ def test_do_prompt() -> None:
61
61
'Q5' : 'no' ,
62
62
'Q6' : 'foo' ,
63
63
}
64
- qs .term_input = mock_input (answers ) # type: ignore[assignment]
64
+ qs .term_input = mock_input (answers )
65
65
66
66
assert qs .do_prompt ('Q1' , default = 'v1' ) == 'v1'
67
67
assert qs .do_prompt ('Q3' , default = 'v3_default' ) == 'v3'
@@ -79,7 +79,7 @@ def test_do_prompt_inputstrip() -> None:
79
79
'Q3' : 'N' ,
80
80
'Q4' : 'N ' ,
81
81
}
82
- qs .term_input = mock_input (answers ) # type: ignore[assignment]
82
+ qs .term_input = mock_input (answers )
83
83
84
84
assert qs .do_prompt ('Q1' ) == 'Y'
85
85
assert qs .do_prompt ('Q2' ) == 'Yes'
@@ -91,12 +91,12 @@ def test_do_prompt_with_nonascii() -> None:
91
91
answers = {
92
92
'Q1' : '\u30c9 \u30a4 \u30c4 ' ,
93
93
}
94
- qs .term_input = mock_input (answers ) # type: ignore[assignment]
94
+ qs .term_input = mock_input (answers )
95
95
result = qs .do_prompt ('Q1' , default = '\u65e5 \u672c ' )
96
96
assert result == '\u30c9 \u30a4 \u30c4 '
97
97
98
98
99
- def test_quickstart_defaults (tmp_path ) :
99
+ def test_quickstart_defaults (tmp_path : Path ) -> None :
100
100
answers = {
101
101
'Root path' : str (tmp_path ),
102
102
'Project name' : 'Sphinx Test' ,
@@ -127,7 +127,7 @@ def test_quickstart_defaults(tmp_path):
127
127
assert (tmp_path / 'make.bat' ).is_file ()
128
128
129
129
130
- def test_quickstart_all_answers (tmp_path ) :
130
+ def test_quickstart_all_answers (tmp_path : Path ) -> None :
131
131
answers = {
132
132
'Root path' : str (tmp_path ),
133
133
'Separate source and build' : 'y' ,
@@ -185,7 +185,7 @@ def test_quickstart_all_answers(tmp_path):
185
185
assert (tmp_path / 'source' / 'contents.txt' ).is_file ()
186
186
187
187
188
- def test_generated_files_eol (tmp_path ) :
188
+ def test_generated_files_eol (tmp_path : Path ) -> None :
189
189
answers = {
190
190
'Root path' : str (tmp_path ),
191
191
'Project name' : 'Sphinx Test' ,
@@ -205,7 +205,7 @@ def assert_eol(filename: Path, eol: str) -> None:
205
205
assert_eol (tmp_path / 'Makefile' , '\n ' )
206
206
207
207
208
- def test_quickstart_and_build (tmp_path ) :
208
+ def test_quickstart_and_build (tmp_path : Path ) -> None :
209
209
answers = {
210
210
'Root path' : str (tmp_path ),
211
211
'Project name' : 'Fullwidth characters: \u30c9 \u30a4 \u30c4 ' ,
@@ -224,7 +224,7 @@ def test_quickstart_and_build(tmp_path):
224
224
assert not warnings
225
225
226
226
227
- def test_default_filename (tmp_path ) :
227
+ def test_default_filename (tmp_path : Path ) -> None :
228
228
answers = {
229
229
'Root path' : str (tmp_path ),
230
230
'Project name' : '\u30c9 \u30a4 \u30c4 ' , # Fullwidth characters only
@@ -242,7 +242,7 @@ def test_default_filename(tmp_path):
242
242
exec (conffile .read_text (encoding = 'utf8' ), ns ) # NoQA: S102
243
243
244
244
245
- def test_extensions (tmp_path ) :
245
+ def test_extensions (tmp_path : Path ) -> None :
246
246
qs .main ([
247
247
'-q' ,
248
248
'-p' ,
@@ -261,7 +261,7 @@ def test_extensions(tmp_path):
261
261
assert ns ['extensions' ] == ['foo' , 'bar' , 'baz' ]
262
262
263
263
264
- def test_exits_when_existing_confpy (monkeypatch ) :
264
+ def test_exits_when_existing_confpy (monkeypatch : pytest . MonkeyPatch ) -> None :
265
265
# The code detects existing conf.py with path.is_file()
266
266
# so we mock it as True with pytest's monkeypatch
267
267
monkeypatch .setattr ('os.path.isfile' , lambda path : True )
0 commit comments