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

Class TestOptionalsSingleDashLong

Lib/test/test_argparse.py:384–395  ·  view source on GitHub ↗

Test an Optional with a multi-character single-dash option string

Source from the content-addressed store, hash-verified

382
383
384class TestOptionalsSingleDashLong(ParserTestCase):
385 """Test an Optional with a multi-character single-dash option string"""
386
387 argument_signatures = [Sig('-foo')]
388 failures = ['-foo', 'a', '--foo', '-foo --foo', '-foo -y', '-fooa']
389 successes = [
390 ('', NS(foo=None)),
391 ('-foo a', NS(foo='a')),
392 ('-foo -1', NS(foo='-1')),
393 ('-fo a', NS(foo='a')),
394 ('-f a', NS(foo='a')),
395 ]
396
397
398class TestOptionalsSingleDashSubsetAmbiguous(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…