summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2022-01-13 11:04:10 -0800
committerDavid Lord <davidism@gmail.com>2022-01-13 11:04:10 -0800
commitc63c70dabd3f86ca68678b4f00951f78f52d0270 (patch)
treefceeff9682963158a9941706ac593fd440a194a0 /tests
parent051d57cef4ce59212dc1175ad4550743bf47d840 (diff)
parentee5fdbf1f9e267247d6de765329d2cc9bdd76206 (diff)
downloadclick-c63c70dabd3f86ca68678b4f00951f78f52d0270.tar.gz
Merge branch '8.0.x'
Diffstat (limited to 'tests')
-rw-r--r--tests/test_options.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_options.py b/tests/test_options.py
index 739da4e..7367a32 100644
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -305,6 +305,19 @@ def test_dynamic_default_help_text(runner):
assert "(current user)" in result.output
+def test_dynamic_default_help_special_method(runner):
+ class Value:
+ def __call__(self):
+ return 42
+
+ def __str__(self):
+ return "special value"
+
+ opt = click.Option(["-a"], default=Value(), show_default=True)
+ ctx = click.Context(click.Command("cli"))
+ assert "special value" in opt.get_help_record(ctx)[1]
+
+
@pytest.mark.parametrize(
("type", "expect"),
[