diff options
Diffstat (limited to 'tests/test_options.py')
| -rw-r--r-- | tests/test_options.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_options.py b/tests/test_options.py index 4ad7f3c..bad4f42 100644 --- a/tests/test_options.py +++ b/tests/test_options.py @@ -273,6 +273,22 @@ def test_show_envvar_auto_prefix(runner): assert 'TEST_ARG1' in result.output +def test_show_envvar_auto_prefix_dash_in_command(runner): + @click.group() + def cli(): + pass + + @cli.command() + @click.option('--baz', show_envvar=True) + def foo_bar(baz): + pass + + result = runner.invoke(cli, ['foo-bar', '--help'], + auto_envvar_prefix='TEST') + assert not result.exception + assert 'TEST_FOO_BAR_BAZ' in result.output + + def test_custom_validation(runner): def validate_pos_int(ctx, param, value): if value < 0: |
