@@ -361,7 +361,7 @@ def test_bad_subcommand_help(ac_app):
361
361
362
362
363
363
@pytest .mark .parametrize (
364
- 'command, text, completions' ,
364
+ ( 'command' , ' text' , ' completions') ,
365
365
[
366
366
('' , 'mus' , ['music ' ]),
367
367
('music' , 'cre' , ['create ' ]),
@@ -388,7 +388,7 @@ def test_complete_help(ac_app, command, text, completions):
388
388
389
389
390
390
@pytest .mark .parametrize (
391
- 'subcommand, text, completions' ,
391
+ ( 'subcommand' , ' text' , ' completions') ,
392
392
[('create' , '' , ['jazz' , 'rock' ]), ('create' , 'ja' , ['jazz ' ]), ('create' , 'foo' , []), ('creab' , 'ja' , [])],
393
393
)
394
394
def test_subcommand_completions (ac_app , subcommand , text , completions ):
@@ -406,7 +406,7 @@ def test_subcommand_completions(ac_app, subcommand, text, completions):
406
406
407
407
408
408
@pytest .mark .parametrize (
409
- 'command_and_args, text, completion_matches, display_matches' ,
409
+ ( 'command_and_args' , ' text' , ' completion_matches' , ' display_matches') ,
410
410
[
411
411
# Complete all flags (suppressed will not show)
412
412
(
@@ -547,13 +547,12 @@ def test_autcomp_flag_completion(ac_app, command_and_args, text, completion_matc
547
547
else :
548
548
assert first_match is None
549
549
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 )
553
552
554
553
555
554
@pytest .mark .parametrize (
556
- 'flag, text, completions' ,
555
+ ( 'flag' , ' text' , ' completions') ,
557
556
[
558
557
('-l' , '' , ArgparseCompleterTester .static_choices_list ),
559
558
('--list' , 's' , ['static' , 'stop' ]),
@@ -588,7 +587,7 @@ def test_autocomp_flag_choices_completion(ac_app, flag, text, completions):
588
587
589
588
590
589
@pytest .mark .parametrize (
591
- 'pos, text, completions' ,
590
+ ( 'pos' , ' text' , ' completions') ,
592
591
[
593
592
(1 , '' , ArgparseCompleterTester .static_choices_list ),
594
593
(1 , 's' , ['static' , 'stop' ]),
@@ -639,11 +638,12 @@ def test_flag_sorting(ac_app):
639
638
begidx = endidx - len (text )
640
639
641
640
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
643
643
644
644
645
645
@pytest .mark .parametrize (
646
- 'flag, text, completions' ,
646
+ ( 'flag' , ' text' , ' completions') ,
647
647
[('-c' , '' , ArgparseCompleterTester .completions_for_flag ), ('--completer' , 'f' , ['flag' , 'fairly' ])],
648
648
)
649
649
def test_autocomp_flag_completers (ac_app , flag , text , completions ):
@@ -661,7 +661,7 @@ def test_autocomp_flag_completers(ac_app, flag, text, completions):
661
661
662
662
663
663
@pytest .mark .parametrize (
664
- 'pos, text, completions' ,
664
+ ( 'pos' , ' text' , ' completions') ,
665
665
[
666
666
(1 , '' , ArgparseCompleterTester .completions_for_pos_1 ),
667
667
(1 , 'p' , ['positional_1' , 'probably' ]),
@@ -763,7 +763,7 @@ def test_completion_items(ac_app):
763
763
764
764
765
765
@pytest .mark .parametrize (
766
- 'num_aliases, show_description' ,
766
+ ( 'num_aliases' , ' show_description') ,
767
767
[
768
768
# The number of completion results determines if the description field of CompletionItems gets displayed
769
769
# 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):
803
803
804
804
805
805
@pytest .mark .parametrize (
806
- 'args, completions' ,
806
+ ( 'args' , ' completions') ,
807
807
[
808
808
# Flag with nargs = 2
809
809
('--set_value' , ArgparseCompleterTester .set_value_choices ),
@@ -869,7 +869,7 @@ def test_autcomp_nargs(ac_app, args, completions):
869
869
870
870
871
871
@pytest .mark .parametrize (
872
- 'command_and_args, text, is_error' ,
872
+ ( 'command_and_args' , ' text' , ' is_error') ,
873
873
[
874
874
# Flag is finished before moving on
875
875
('hint --flag foo --' , '' , False ),
@@ -986,7 +986,7 @@ def test_completion_items_descriptive_header(ac_app):
986
986
987
987
988
988
@pytest .mark .parametrize (
989
- 'command_and_args, text, has_hint' ,
989
+ ( 'command_and_args' , ' text' , ' has_hint') ,
990
990
[
991
991
# Normal cases
992
992
('hint' , '' , True ),
@@ -1045,7 +1045,7 @@ def test_autocomp_hint_no_help_text(ac_app, capsys):
1045
1045
1046
1046
1047
1047
@pytest .mark .parametrize (
1048
- 'args, text' ,
1048
+ ( 'args' , ' text') ,
1049
1049
[
1050
1050
# Exercise a flag arg and choices function that raises a CompletionError
1051
1051
('--choice ' , 'choice' ),
@@ -1066,7 +1066,7 @@ def test_completion_error(ac_app, capsys, args, text):
1066
1066
1067
1067
1068
1068
@pytest .mark .parametrize (
1069
- 'command_and_args, completions' ,
1069
+ ( 'command_and_args' , ' completions') ,
1070
1070
[
1071
1071
# Exercise a choices function that receives arg_tokens dictionary
1072
1072
('arg_tokens choice subcmd' , ['choice' , 'subcmd' ]),
@@ -1092,7 +1092,7 @@ def test_arg_tokens(ac_app, command_and_args, completions):
1092
1092
1093
1093
1094
1094
@pytest .mark .parametrize (
1095
- 'command_and_args, text, output_contains, first_match' ,
1095
+ ( 'command_and_args' , ' text' , ' output_contains' , ' first_match') ,
1096
1096
[
1097
1097
# Group isn't done. Hint will show for optional positional and no completions returned
1098
1098
('mutex' , '' , 'the optional positional' , None ),
@@ -1188,7 +1188,9 @@ def test_complete_command_help_no_tokens(ac_app):
1188
1188
assert not completions
1189
1189
1190
1190
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
+ )
1192
1194
def test_complete_standalone (ac_app , flag , completions ):
1193
1195
text = ''
1194
1196
line = 'standalone {} {}' .format (flag , text )
0 commit comments