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

Method test_help

Lib/test/test_argparse.py:2803–2818  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2801 'usage: PROG --foo FOO sub [-h] arg\n')
2802
2803 def test_help(self):
2804 self.assertEqual(self.parser.format_usage(),
2805 'usage: PROG [-h] [--foo] bar {1,2,3} ...\n')
2806 self.assertEqual(self.parser.format_help(), textwrap.dedent('''\
2807 usage: PROG [-h] [--foo] bar {1,2,3} ...
2808
2809 main description
2810
2811 positional arguments:
2812 bar bar help
2813 {1,2,3} command help
2814
2815 options:
2816 -h, --help show this help message and exit
2817 --foo foo help
2818 '''))
2819
2820 def test_help_extra_prefix_chars(self):
2821 # Make sure - is still used for help if it is a non-first prefix char

Callers

nothing calls this directly

Calls 4

assertEqualMethod · 0.45
format_usageMethod · 0.45
format_helpMethod · 0.45
dedentMethod · 0.45

Tested by

no test coverage detected