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

Method test_remainder

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

Source from the content-addressed store, hash-verified

6706 self.assertEqual(bar.required, True)
6707
6708 def test_remainder(self):
6709 # Intermixed and remainder are incompatible
6710 parser = ErrorRaisingArgumentParser(prog='PROG')
6711 parser.add_argument('-z')
6712 parser.add_argument('x')
6713 parser.add_argument('y', nargs='...')
6714 argv = 'X A B -z Z'.split()
6715 # intermixed fails with '...' (also 'A...')
6716 # self.assertRaises(TypeError, parser.parse_intermixed_args, argv)
6717 with self.assertRaises(TypeError) as cm:
6718 parser.parse_intermixed_args(argv)
6719 self.assertRegex(str(cm.exception), r'\.\.\.')
6720
6721 def test_required_exclusive(self):
6722 # required mutually exclusive group; intermixed works fine

Callers

nothing calls this directly

Calls 7

strFunction · 0.85
parse_intermixed_argsMethod · 0.80
assertRegexMethod · 0.80
add_argumentMethod · 0.45
splitMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected