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

Method test_help_extra_prefix_chars

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

Source from the content-addressed store, hash-verified

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
2822 parser = self._get_parser(prefix_chars='+:-')
2823 self.assertEqual(parser.format_usage(),
2824 'usage: PROG [-h] [++foo] bar {1,2,3} ...\n')
2825 self.assertEqual(parser.format_help(), textwrap.dedent('''\
2826 usage: PROG [-h] [++foo] bar {1,2,3} ...
2827
2828 main description
2829
2830 positional arguments:
2831 bar bar help
2832 {1,2,3} command help
2833
2834 options:
2835 -h, --help show this help message and exit
2836 ++foo foo help
2837 '''))
2838
2839 def test_help_non_breaking_spaces(self):
2840 parser = ErrorRaisingArgumentParser(

Callers

nothing calls this directly

Calls 5

_get_parserMethod · 0.95
assertEqualMethod · 0.45
format_usageMethod · 0.45
format_helpMethod · 0.45
dedentMethod · 0.45

Tested by

no test coverage detected