@@ -361,7 +361,7 @@ def test_bad_subcommand_help(ac_app):
361361
362362
363363@pytest .mark .parametrize (
364- 'command, text, completions' ,
364+ ( 'command' , ' text' , ' completions') ,
365365 [
366366 ('' , 'mus' , ['music ' ]),
367367 ('music' , 'cre' , ['create ' ]),
@@ -388,7 +388,7 @@ def test_complete_help(ac_app, command, text, completions):
388388
389389
390390@pytest .mark .parametrize (
391- 'subcommand, text, completions' ,
391+ ( 'subcommand' , ' text' , ' completions') ,
392392 [('create' , '' , ['jazz' , 'rock' ]), ('create' , 'ja' , ['jazz ' ]), ('create' , 'foo' , []), ('creab' , 'ja' , [])],
393393)
394394def test_subcommand_completions (ac_app , subcommand , text , completions ):
@@ -406,7 +406,7 @@ def test_subcommand_completions(ac_app, subcommand, text, completions):
406406
407407
408408@pytest .mark .parametrize (
409- 'command_and_args, text, completion_matches, display_matches' ,
409+ ( 'command_and_args' , ' text' , ' completion_matches' , ' display_matches') ,
410410 [
411411 # Complete all flags (suppressed will not show)
412412 (
@@ -547,13 +547,12 @@ def test_autcomp_flag_completion(ac_app, command_and_args, text, completion_matc
547547 else :
548548 assert first_match is None
549549
550- assert ac_app .completion_matches == sorted (
551- completion_matches , key = ac_app .default_sort_key
552- ) and ac_app .display_matches == sorted (display_matches , key = ac_app .default_sort_key )
550+ assert ac_app .completion_matches == sorted (completion_matches , key = ac_app .default_sort_key )
551+ assert ac_app .display_matches == sorted (display_matches , key = ac_app .default_sort_key )
553552
554553
555554@pytest .mark .parametrize (
556- 'flag, text, completions' ,
555+ ( 'flag' , ' text' , ' completions') ,
557556 [
558557 ('-l' , '' , ArgparseCompleterTester .static_choices_list ),
559558 ('--list' , 's' , ['static' , 'stop' ]),
@@ -588,7 +587,7 @@ def test_autocomp_flag_choices_completion(ac_app, flag, text, completions):
588587
589588
590589@pytest .mark .parametrize (
591- 'pos, text, completions' ,
590+ ( 'pos' , ' text' , ' completions') ,
592591 [
593592 (1 , '' , ArgparseCompleterTester .static_choices_list ),
594593 (1 , 's' , ['static' , 'stop' ]),
@@ -639,11 +638,12 @@ def test_flag_sorting(ac_app):
639638 begidx = endidx - len (text )
640639
641640 first_match = complete_tester (text , line , begidx , endidx , ac_app )
642- assert first_match is not None and ac_app .completion_matches == option_strings
641+ assert first_match is not None
642+ assert ac_app .completion_matches == option_strings
643643
644644
645645@pytest .mark .parametrize (
646- 'flag, text, completions' ,
646+ ( 'flag' , ' text' , ' completions') ,
647647 [('-c' , '' , ArgparseCompleterTester .completions_for_flag ), ('--completer' , 'f' , ['flag' , 'fairly' ])],
648648)
649649def test_autocomp_flag_completers (ac_app , flag , text , completions ):
@@ -661,7 +661,7 @@ def test_autocomp_flag_completers(ac_app, flag, text, completions):
661661
662662
663663@pytest .mark .parametrize (
664- 'pos, text, completions' ,
664+ ( 'pos' , ' text' , ' completions') ,
665665 [
666666 (1 , '' , ArgparseCompleterTester .completions_for_pos_1 ),
667667 (1 , 'p' , ['positional_1' , 'probably' ]),
@@ -763,7 +763,7 @@ def test_completion_items(ac_app):
763763
764764
765765@pytest .mark .parametrize (
766- 'num_aliases, show_description' ,
766+ ( 'num_aliases' , ' show_description') ,
767767 [
768768 # The number of completion results determines if the description field of CompletionItems gets displayed
769769 # in the tab completions. The count must be greater than 1 and less than ac_app.max_completion_items,
@@ -803,7 +803,7 @@ def test_max_completion_items(ac_app, num_aliases, show_description):
803803
804804
805805@pytest .mark .parametrize (
806- 'args, completions' ,
806+ ( 'args' , ' completions') ,
807807 [
808808 # Flag with nargs = 2
809809 ('--set_value' , ArgparseCompleterTester .set_value_choices ),
@@ -869,7 +869,7 @@ def test_autcomp_nargs(ac_app, args, completions):
869869
870870
871871@pytest .mark .parametrize (
872- 'command_and_args, text, is_error' ,
872+ ( 'command_and_args' , ' text' , ' is_error') ,
873873 [
874874 # Flag is finished before moving on
875875 ('hint --flag foo --' , '' , False ),
@@ -986,7 +986,7 @@ def test_completion_items_descriptive_header(ac_app):
986986
987987
988988@pytest .mark .parametrize (
989- 'command_and_args, text, has_hint' ,
989+ ( 'command_and_args' , ' text' , ' has_hint') ,
990990 [
991991 # Normal cases
992992 ('hint' , '' , True ),
@@ -1045,7 +1045,7 @@ def test_autocomp_hint_no_help_text(ac_app, capsys):
10451045
10461046
10471047@pytest .mark .parametrize (
1048- 'args, text' ,
1048+ ( 'args' , ' text') ,
10491049 [
10501050 # Exercise a flag arg and choices function that raises a CompletionError
10511051 ('--choice ' , 'choice' ),
@@ -1066,7 +1066,7 @@ def test_completion_error(ac_app, capsys, args, text):
10661066
10671067
10681068@pytest .mark .parametrize (
1069- 'command_and_args, completions' ,
1069+ ( 'command_and_args' , ' completions') ,
10701070 [
10711071 # Exercise a choices function that receives arg_tokens dictionary
10721072 ('arg_tokens choice subcmd' , ['choice' , 'subcmd' ]),
@@ -1092,7 +1092,7 @@ def test_arg_tokens(ac_app, command_and_args, completions):
10921092
10931093
10941094@pytest .mark .parametrize (
1095- 'command_and_args, text, output_contains, first_match' ,
1095+ ( 'command_and_args' , ' text' , ' output_contains' , ' first_match') ,
10961096 [
10971097 # Group isn't done. Hint will show for optional positional and no completions returned
10981098 ('mutex' , '' , 'the optional positional' , None ),
@@ -1188,7 +1188,9 @@ def test_complete_command_help_no_tokens(ac_app):
11881188 assert not completions
11891189
11901190
1191- @pytest .mark .parametrize ('flag, completions' , [('--provider' , standalone_choices ), ('--completer' , standalone_completions )])
1191+ @pytest .mark .parametrize (
1192+ ('flag' , 'completions' ), [('--provider' , standalone_choices ), ('--completer' , standalone_completions )]
1193+ )
11921194def test_complete_standalone (ac_app , flag , completions ):
11931195 text = ''
11941196 line = 'standalone {} {}' .format (flag , text )
0 commit comments