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

Method test_custom_progname

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

Source from the content-addressed store, hash-verified

550 sys.argv[:] = save_argv
551
552 def test_custom_progname(self):
553 parser = OptionParser(prog="thingy",
554 version="%prog 0.1",
555 usage="%prog arg arg")
556 parser.remove_option("-h")
557 parser.remove_option("--version")
558 expected_usage = "Usage: thingy arg arg\n"
559 self.assertUsage(parser, expected_usage)
560 self.assertVersion(parser, "thingy 0.1")
561 self.assertHelp(parser, expected_usage + "\n")
562
563
564class TestExpandDefaults(BaseTest):

Callers

nothing calls this directly

Calls 5

assertUsageMethod · 0.95
assertVersionMethod · 0.95
OptionParserClass · 0.90
assertHelpMethod · 0.80
remove_optionMethod · 0.45

Tested by

no test coverage detected