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

Class TestOptionalsSingleDash

Lib/test/test_argparse.py:344–355  ·  view source on GitHub ↗

Test an Optional with a single-dash option string

Source from the content-addressed store, hash-verified

342# ===============
343
344class TestOptionalsSingleDash(ParserTestCase):
345 """Test an Optional with a single-dash option string"""
346
347 argument_signatures = [Sig('-x')]
348 failures = ['-x', 'a', '--foo', '-x --foo', '-x -y']
349 successes = [
350 ('', NS(x=None)),
351 ('-x a', NS(x='a')),
352 ('-xa', NS(x='a')),
353 ('-x -1', NS(x='-1')),
354 ('-x-1', NS(x='-1')),
355 ]
356
357
358class TestOptionalsSingleDashCombined(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…