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

Class TestOptionalsAlternatePrefixCharsAddedHelp

Lib/test/test_argparse.py:540–559  ·  view source on GitHub ↗

When ``-`` not in prefix_chars, default operators created for help should use the prefix_chars in use rather than - or -- http://bugs.python.org/issue9444

Source from the content-addressed store, hash-verified

538
539
540class TestOptionalsAlternatePrefixCharsAddedHelp(ParserTestCase):
541 """When ``-`` not in prefix_chars, default operators created for help
542 should use the prefix_chars in use rather than - or --
543 http://bugs.python.org/issue9444"""
544
545 parser_signature = Sig(prefix_chars='+:/', add_help=True)
546 argument_signatures = [
547 Sig('+f', action='store_true'),
548 Sig('::bar'),
549 Sig('/baz', action='store_const', const=42),
550 ]
551 failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz']
552 successes = [
553 ('', NS(f=False, bar=None, baz=None)),
554 ('+f', NS(f=True, bar=None, baz=None)),
555 ('::ba B', NS(f=False, bar='B', baz=None)),
556 ('+f ::bar B', NS(f=True, bar='B', baz=None)),
557 ('+f /b', NS(f=True, bar=None, baz=42)),
558 ('/ba +f', NS(f=True, bar=None, baz=42))
559 ]
560
561
562class TestOptionalsAlternatePrefixCharsMultipleShortArgs(ParserTestCase):

Callers

nothing calls this directly

Calls 2

SigClass · 0.85
NSClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…