diff options
author | Patryk Bęza <patryk@wildland.io> | 2021-06-22 15:47:50 +0200 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2021-07-04 06:43:27 -0700 |
commit | 8967b81b69958c4607a72769c38dbda80d6d7606 (patch) | |
tree | 098786029c08eaaa687aa108d44445fc3c71e0d3 /tests | |
parent | 10611b5fc36e68f33765a07b7690fbfbdb1fea84 (diff) | |
download | click-8967b81b69958c4607a72769c38dbda80d6d7606.tar.gz |
don't show empty multiple=True default
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_options.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_options.py b/tests/test_options.py index bddd194..53179e8 100644 --- a/tests/test_options.py +++ b/tests/test_options.py @@ -728,6 +728,16 @@ def test_do_not_show_no_default(runner): assert "[default: None]" not in message +def test_do_not_show_default_empty_multiple(): + """When show_default is True and multiple=True is set, it should not + print empty default value in --help output. + """ + opt = click.Option(["-a"], multiple=True, help="values", show_default=True) + ctx = click.Context(click.Command("cli")) + message = opt.get_help_record(ctx)[1] + assert message == "values" + + @pytest.mark.parametrize( ("args", "expect"), [ |