@@ -126,17 +126,17 @@ def argparse_app():
126126
127127
128128def test_invalid_syntax (argparse_app ) -> None :
129- out , err = run_cmd (argparse_app , 'speak "' )
129+ _out , err = run_cmd (argparse_app , 'speak "' )
130130 assert err [0 ] == "Invalid syntax: No closing quotation"
131131
132132
133133def test_argparse_basic_command (argparse_app ) -> None :
134- out , err = run_cmd (argparse_app , 'say hello' )
134+ out , _err = run_cmd (argparse_app , 'say hello' )
135135 assert out == ['hello' ]
136136
137137
138138def test_argparse_remove_quotes (argparse_app ) -> None :
139- out , err = run_cmd (argparse_app , 'say "hello there"' )
139+ out , _err = run_cmd (argparse_app , 'say "hello there"' )
140140 assert out == ['hello there' ]
141141
142142
@@ -150,64 +150,64 @@ def test_argparse_with_no_args(argparse_app) -> None:
150150def test_argparser_kwargs (argparse_app , capsys ) -> None :
151151 """Test with_argparser wrapper passes through kwargs to command function"""
152152 argparse_app .do_say ('word' , keyword_arg = "foo" )
153- out , err = capsys .readouterr ()
153+ out , _err = capsys .readouterr ()
154154 assert out == "foo\n "
155155
156156
157157def test_argparse_preserve_quotes (argparse_app ) -> None :
158- out , err = run_cmd (argparse_app , 'tag mytag "hello"' )
158+ out , _err = run_cmd (argparse_app , 'tag mytag "hello"' )
159159 assert out [0 ] == '<mytag>"hello"</mytag>'
160160
161161
162162def test_argparse_custom_namespace (argparse_app ) -> None :
163- out , err = run_cmd (argparse_app , 'test_argparse_ns' )
163+ out , _err = run_cmd (argparse_app , 'test_argparse_ns' )
164164 assert out [0 ] == 'custom'
165165
166166
167167def test_argparse_with_list (argparse_app ) -> None :
168- out , err = run_cmd (argparse_app , 'speak -s hello world!' )
168+ out , _err = run_cmd (argparse_app , 'speak -s hello world!' )
169169 assert out == ['HELLO WORLD!' ]
170170
171171
172172def test_argparse_with_list_remove_quotes (argparse_app ) -> None :
173- out , err = run_cmd (argparse_app , 'speak -s hello "world!"' )
173+ out , _err = run_cmd (argparse_app , 'speak -s hello "world!"' )
174174 assert out == ['HELLO WORLD!' ]
175175
176176
177177def test_argparse_with_list_preserve_quotes (argparse_app ) -> None :
178- out , err = run_cmd (argparse_app , 'test_argparse_with_list_quotes "hello" person' )
178+ out , _err = run_cmd (argparse_app , 'test_argparse_with_list_quotes "hello" person' )
179179 assert out [0 ] == '"hello" person'
180180
181181
182182def test_argparse_with_list_custom_namespace (argparse_app ) -> None :
183- out , err = run_cmd (argparse_app , 'test_argparse_with_list_ns' )
183+ out , _err = run_cmd (argparse_app , 'test_argparse_with_list_ns' )
184184 assert out [0 ] == 'custom'
185185
186186
187187def test_argparse_with_list_and_empty_doc (argparse_app ) -> None :
188- out , err = run_cmd (argparse_app , 'speak -s hello world!' )
188+ out , _err = run_cmd (argparse_app , 'speak -s hello world!' )
189189 assert out == ['HELLO WORLD!' ]
190190
191191
192192def test_argparser_correct_args_with_quotes_and_midline_options (argparse_app ) -> None :
193- out , err = run_cmd (argparse_app , "speak 'This is a' -s test of the emergency broadcast system!" )
193+ out , _err = run_cmd (argparse_app , "speak 'This is a' -s test of the emergency broadcast system!" )
194194 assert out == ['THIS IS A TEST OF THE EMERGENCY BROADCAST SYSTEM!' ]
195195
196196
197197def test_argparser_and_unknown_args_kwargs (argparse_app , capsys ) -> None :
198198 """Test with_argparser wrapper passing through kwargs to command function"""
199199 argparse_app .do_speak ('' , keyword_arg = "foo" )
200- out , err = capsys .readouterr ()
200+ out , _err = capsys .readouterr ()
201201 assert out == "foo\n "
202202
203203
204204def test_argparse_quoted_arguments_multiple (argparse_app ) -> None :
205- out , err = run_cmd (argparse_app , 'say "hello there" "rick & morty"' )
205+ out , _err = run_cmd (argparse_app , 'say "hello there" "rick & morty"' )
206206 assert out == ['hello there rick & morty' ]
207207
208208
209209def test_argparse_help_docstring (argparse_app ) -> None :
210- out , err = run_cmd (argparse_app , 'help say' )
210+ out , _err = run_cmd (argparse_app , 'help say' )
211211 assert out [0 ].startswith ('Usage: say' )
212212 assert out [1 ] == ''
213213 assert out [2 ] == 'Repeat what you tell me to.'
@@ -216,32 +216,32 @@ def test_argparse_help_docstring(argparse_app) -> None:
216216
217217
218218def test_argparse_help_description (argparse_app ) -> None :
219- out , err = run_cmd (argparse_app , 'help tag' )
219+ out , _err = run_cmd (argparse_app , 'help tag' )
220220 assert out [0 ].startswith ('Usage: tag' )
221221 assert out [1 ] == ''
222222 assert out [2 ] == 'create a html tag'
223223
224224
225225def test_argparse_prog (argparse_app ) -> None :
226- out , err = run_cmd (argparse_app , 'help tag' )
226+ out , _err = run_cmd (argparse_app , 'help tag' )
227227 progname = out [0 ].split (' ' )[1 ]
228228 assert progname == 'tag'
229229
230230
231231def test_arglist (argparse_app ) -> None :
232- out , err = run_cmd (argparse_app , 'arglist "we should" get these' )
232+ out , _err = run_cmd (argparse_app , 'arglist "we should" get these' )
233233 assert out [0 ] == 'True'
234234
235235
236236def test_arglist_kwargs (argparse_app , capsys ) -> None :
237237 """Test with_argument_list wrapper passes through kwargs to command function"""
238238 argparse_app .do_arglist ('arg' , keyword_arg = "foo" )
239- out , err = capsys .readouterr ()
239+ out , _err = capsys .readouterr ()
240240 assert out == "foo\n "
241241
242242
243243def test_preservelist (argparse_app ) -> None :
244- out , err = run_cmd (argparse_app , 'preservelist foo "bar baz"' )
244+ out , _err = run_cmd (argparse_app , 'preservelist foo "bar baz"' )
245245 assert out [0 ] == "['foo', '\" bar baz\" ']"
246246
247247
@@ -332,70 +332,70 @@ def subcommand_app():
332332
333333
334334def test_subcommand_foo (subcommand_app ) -> None :
335- out , err = run_cmd (subcommand_app , 'base foo -x2 5.0' )
335+ out , _err = run_cmd (subcommand_app , 'base foo -x2 5.0' )
336336 assert out == ['10.0' ]
337337
338338
339339def test_subcommand_bar (subcommand_app ) -> None :
340- out , err = run_cmd (subcommand_app , 'base bar baz' )
340+ out , _err = run_cmd (subcommand_app , 'base bar baz' )
341341 assert out == ['((baz))' ]
342342
343343
344344def test_subcommand_invalid (subcommand_app ) -> None :
345- out , err = run_cmd (subcommand_app , 'base baz' )
345+ _out , err = run_cmd (subcommand_app , 'base baz' )
346346 assert err [0 ].startswith ('Usage: base' )
347347 assert err [1 ].startswith ("Error: argument SUBCOMMAND: invalid choice: 'baz'" )
348348
349349
350350def test_subcommand_base_help (subcommand_app ) -> None :
351- out , err = run_cmd (subcommand_app , 'help base' )
351+ out , _err = run_cmd (subcommand_app , 'help base' )
352352 assert out [0 ].startswith ('Usage: base' )
353353 assert out [1 ] == ''
354354 assert out [2 ] == 'Base command help'
355355
356356
357357def test_subcommand_help (subcommand_app ) -> None :
358358 # foo has no aliases
359- out , err = run_cmd (subcommand_app , 'help base foo' )
359+ out , _err = run_cmd (subcommand_app , 'help base foo' )
360360 assert out [0 ].startswith ('Usage: base foo' )
361361 assert out [1 ] == ''
362362 assert out [2 ] == 'Positional Arguments:'
363363
364364 # bar has aliases (usage should never show alias name)
365- out , err = run_cmd (subcommand_app , 'help base bar' )
365+ out , _err = run_cmd (subcommand_app , 'help base bar' )
366366 assert out [0 ].startswith ('Usage: base bar' )
367367 assert out [1 ] == ''
368368 assert out [2 ] == 'Positional Arguments:'
369369
370- out , err = run_cmd (subcommand_app , 'help base bar_1' )
370+ out , _err = run_cmd (subcommand_app , 'help base bar_1' )
371371 assert out [0 ].startswith ('Usage: base bar' )
372372 assert out [1 ] == ''
373373 assert out [2 ] == 'Positional Arguments:'
374374
375- out , err = run_cmd (subcommand_app , 'help base bar_2' )
375+ out , _err = run_cmd (subcommand_app , 'help base bar_2' )
376376 assert out [0 ].startswith ('Usage: base bar' )
377377 assert out [1 ] == ''
378378 assert out [2 ] == 'Positional Arguments:'
379379
380380 # helpless has aliases and no help text (usage should never show alias name)
381- out , err = run_cmd (subcommand_app , 'help base helpless' )
381+ out , _err = run_cmd (subcommand_app , 'help base helpless' )
382382 assert out [0 ].startswith ('Usage: base helpless' )
383383 assert out [1 ] == ''
384384 assert out [2 ] == 'Positional Arguments:'
385385
386- out , err = run_cmd (subcommand_app , 'help base helpless_1' )
386+ out , _err = run_cmd (subcommand_app , 'help base helpless_1' )
387387 assert out [0 ].startswith ('Usage: base helpless' )
388388 assert out [1 ] == ''
389389 assert out [2 ] == 'Positional Arguments:'
390390
391- out , err = run_cmd (subcommand_app , 'help base helpless_2' )
391+ out , _err = run_cmd (subcommand_app , 'help base helpless_2' )
392392 assert out [0 ].startswith ('Usage: base helpless' )
393393 assert out [1 ] == ''
394394 assert out [2 ] == 'Positional Arguments:'
395395
396396
397397def test_subcommand_invalid_help (subcommand_app ) -> None :
398- out , err = run_cmd (subcommand_app , 'help base baz' )
398+ out , _err = run_cmd (subcommand_app , 'help base baz' )
399399 assert out [0 ].startswith ('Usage: base' )
400400
401401
0 commit comments