When show_default is a string show that value as default.
(runner)
| 1265 | |
| 1266 | |
| 1267 | def 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 | |
| 1276 | def test_string_show_default_shows_custom_string_in_prompt(runner): |
nothing calls this directly
no test coverage detected