@@ -733,10 +733,15 @@ def cli(foo, bar):
733733 assert "bar" not in result .output
734734
735735
736- def test_help_option (runner ):
736+ @pytest .mark .parametrize ('param_decls, options, output' , [
737+ ((), ['--help' ], '--help' ),
738+ (('-h' , '--help' ), ['-h' ], '-h, --help' ),
739+ (('-h' , '--help' ), ['--help' ], '-h, --help' ),
740+ ])
741+ def test_help_option (runner , param_decls , options , output ):
737742 @click .command ()
738743 @optgroup ('Help Options' )
739- @optgroup .help_option ('-h' , '--help' )
744+ @optgroup .help_option (* param_decls )
740745 def cli () -> None :
741746 click .echo ('Running command.' )
742747
@@ -745,11 +750,11 @@ def cli() -> None:
745750 assert 'Running command.' in result .output
746751 assert 'Usage:' not in result .output
747752
748- result = runner .invoke (cli , [ '-h' ] )
753+ result = runner .invoke (cli , options )
749754 assert not result .exception
750755 assert 'Running command.' not in result .output
751756 assert 'Usage:' in result .output
752- assert '-h, --help' in result .output
757+ assert output in result .output
753758
754759
755760def test_wrapped_functions (runner ):
0 commit comments