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

Class TestOptionalsDoubleDash

Lib/test/test_argparse.py:450–461  ·  view source on GitHub ↗

Test an Optional with a double-dash option string

Source from the content-addressed store, hash-verified

448
449
450class TestOptionalsDoubleDash(ParserTestCase):
451 """Test an Optional with a double-dash option string"""
452
453 argument_signatures = [Sig('--foo')]
454 failures = ['--foo', '-f', '-f a', 'a', '--foo -x', '--foo --bar']
455 successes = [
456 ('', NS(foo=None)),
457 ('--foo a', NS(foo='a')),
458 ('--foo=a', NS(foo='a')),
459 ('--foo -2.5', NS(foo='-2.5')),
460 ('--foo=-2.5', NS(foo='-2.5')),
461 ]
462
463
464class TestOptionalsDoubleDashPartialMatch(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…