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

Function test_dynamic_default_help_special_method

tests/test_options.py:666–677  ·  view source on GitHub ↗
(runner)

Source from the content-addressed store, hash-verified

664
665
666def test_dynamic_default_help_special_method(runner):
667 class Value:
668 def __call__(self):
669 return 42
670
671 def __str__(self):
672 return "special value"
673
674 opt = click.Option(["-a"], default=Value(), show_default=True)
675 ctx = click.Context(click.Command("cli"))
676 assert opt.get_help_extra(ctx) == {"default": "special value"}
677 assert "special value" in opt.get_help_record(ctx)[1]
678
679
680@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

get_help_extraMethod · 0.95
get_help_recordMethod · 0.95
ValueClass · 0.85

Tested by

no test coverage detected