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

Method test_optionals

Lib/test/test_argparse.py:6499–6504  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6497 parser.parse_args(['x'])
6498
6499 def test_optionals(self):
6500 parser = argparse.ArgumentParser()
6501 parser.add_argument('--foo')
6502 args, extras = parser.parse_known_args('--foo F --bar --baz'.split())
6503 self.assertEqual(NS(foo='F'), args)
6504 self.assertEqual(['--bar', '--baz'], extras)
6505
6506 def test_mixed(self):
6507 parser = argparse.ArgumentParser()

Callers

nothing calls this directly

Calls 5

parse_known_argsMethod · 0.95
NSClass · 0.70
add_argumentMethod · 0.45
splitMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected