MCPcopy Index your code
hub / github.com/python/cpython / test_callback_help

Method test_callback_help

Lib/test/test_optparse.py:1131–1143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1129 [])
1130
1131 def test_callback_help(self):
1132 # This test was prompted by SF bug #960515 -- the point is
1133 # not to inspect the help text, just to make sure that
1134 # format_help() doesn't crash.
1135 parser = OptionParser(usage=SUPPRESS_USAGE)
1136 parser.remove_option("-h")
1137 parser.add_option("-t", "--test", action="callback",
1138 callback=lambda: None, type="string",
1139 help="foo")
1140
1141 expected_help = ("Options:\n"
1142 " -t TEST, --test=TEST foo\n")
1143 self.assertHelp(parser, expected_help)
1144
1145
1146class TestCallbackExtraArgs(BaseTest):

Callers

nothing calls this directly

Calls 4

OptionParserClass · 0.90
assertHelpMethod · 0.80
remove_optionMethod · 0.45
add_optionMethod · 0.45

Tested by

no test coverage detected