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

Method test_nongroup_first

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

Source from the content-addressed store, hash-verified

3060 """Tests that order of group positionals matches construction order"""
3061
3062 def test_nongroup_first(self):
3063 parser = ErrorRaisingArgumentParser()
3064 parser.add_argument('foo')
3065 group = parser.add_argument_group('g')
3066 group.add_argument('bar')
3067 parser.add_argument('baz')
3068 expected = NS(foo='1', bar='2', baz='3')
3069 result = parser.parse_args('1 2 3'.split())
3070 self.assertEqual(expected, result)
3071
3072 def test_group_first(self):
3073 parser = ErrorRaisingArgumentParser()

Callers

nothing calls this directly

Calls 7

parse_argsMethod · 0.95
NSClass · 0.70
add_argumentMethod · 0.45
add_argument_groupMethod · 0.45
splitMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected