MCPcopy
hub / github.com/pallets/click / test_show_default_string

Function test_show_default_string

tests/test_options.py:1267–1273  ·  view source on GitHub ↗

When show_default is a string show that value as default.

(runner)

Source from the content-addressed store, hash-verified

1265
1266
1267def test_show_default_string(runner):
1268 """When show_default is a string show that value as default."""
1269 opt = click.Option(["--limit"], show_default="unlimited")
1270 ctx = click.Context(click.Command("cli"))
1271 assert opt.get_help_extra(ctx) == {"default": "(unlimited)"}
1272 message = opt.get_help_record(ctx)[1]
1273 assert "[default: (unlimited)]" in message
1274
1275
1276def test_string_show_default_shows_custom_string_in_prompt(runner):

Callers

nothing calls this directly

Calls 2

get_help_extraMethod · 0.95
get_help_recordMethod · 0.95

Tested by

no test coverage detected