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

Method get_parser

Lib/test/test_argparse.py:3493–3498  ·  view source on GitHub ↗
(self, required=None)

Source from the content-addressed store, hash-verified

3491class TestMutuallyExclusiveSimple(MEMixin, TestCase):
3492
3493 def get_parser(self, required=None):
3494 parser = ErrorRaisingArgumentParser(prog='PROG')
3495 group = parser.add_mutually_exclusive_group(required=required)
3496 group.add_argument('--bar', help='bar help')
3497 group.add_argument('--baz', nargs='?', const='Z', help='baz help')
3498 return parser
3499
3500 failures = ['--bar X --baz Y', '--bar X --baz']
3501 successes = [

Callers

nothing calls this directly

Calls 3

add_argumentMethod · 0.45

Tested by

no test coverage detected