summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_options.py10
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"),
[