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

Method test_help_blank

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

Source from the content-addressed store, hash-verified

2855 '''))
2856
2857 def test_help_blank(self):
2858 # Issue 24444
2859 parser = ErrorRaisingArgumentParser(
2860 prog='PROG', description='main description')
2861 parser.add_argument(
2862 'foo',
2863 help=' ')
2864 self.assertEqual(parser.format_help(), textwrap.dedent('''\
2865 usage: PROG [-h] foo
2866
2867 main description
2868
2869 positional arguments:
2870 foo \n
2871 options:
2872 -h, --help show this help message and exit
2873 '''))
2874
2875 parser = ErrorRaisingArgumentParser(
2876 prog='PROG', description='main description')
2877 parser.add_argument(
2878 'foo', choices=[],
2879 help='%(choices)s')
2880 self.assertEqual(parser.format_help(), textwrap.dedent('''\
2881 usage: PROG [-h] {}
2882
2883 main description
2884
2885 positional arguments:
2886 {} \n
2887 options:
2888 -h, --help show this help message and exit
2889 '''))
2890
2891 def test_help_alternate_prefix_chars(self):
2892 parser = self._get_parser(prefix_chars='+:/')

Callers

nothing calls this directly

Calls 5

add_argumentMethod · 0.45
assertEqualMethod · 0.45
format_helpMethod · 0.45
dedentMethod · 0.45

Tested by

no test coverage detected