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

Method test_parent_help

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

Source from the content-addressed store, hash-verified

3248 parser.parse_args, 'bar -b -a 4'.split())
3249
3250 def test_parent_help(self):
3251 parents = [self.abcd_parent, self.wxyz_parent]
3252 parser = ErrorRaisingArgumentParser(prog='PROG', parents=parents)
3253 parser_help = parser.format_help()
3254 self.assertEqual(parser_help, textwrap.dedent('''\
3255 usage: PROG [-h] [-b B] [--d D] [--w W] [-y Y] a z
3256
3257 positional arguments:
3258 a
3259 z
3260
3261 options:
3262 -h, --help show this help message and exit
3263 -b B
3264 --w W
3265
3266 c:
3267 --d D
3268
3269 x:
3270 -y Y
3271 '''))
3272
3273 def test_groups_parents(self):
3274 parent = ErrorRaisingArgumentParser(add_help=False)

Callers

nothing calls this directly

Calls 4

format_helpMethod · 0.45
assertEqualMethod · 0.45
dedentMethod · 0.45

Tested by

no test coverage detected