MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_optionals

Method test_optionals

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

Source from the content-addressed store, hash-verified

6378 parser.parse_args(['x'])
6379
6380 def test_optionals(self):
6381 parser = argparse.ArgumentParser()
6382 parser.add_argument('--foo')
6383 args, extras = parser.parse_known_args('--foo F --bar --baz'.split())
6384 self.assertEqual(NS(foo='F'), args)
6385 self.assertEqual(['--bar', '--baz'], extras)
6386
6387 def test_mixed(self):
6388 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