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

Method test_remainder

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

Source from the content-addressed store, hash-verified

6573 self.assertEqual(bar.required, True)
6574
6575 def test_remainder(self):
6576 # Intermixed and remainder are incompatible
6577 parser = ErrorRaisingArgumentParser(prog='PROG')
6578 parser.add_argument('-z')
6579 parser.add_argument('x')
6580 parser.add_argument('y', nargs='...')
6581 argv = 'X A B -z Z'.split()
6582 # intermixed fails with '...' (also 'A...')
6583 # self.assertRaises(TypeError, parser.parse_intermixed_args, argv)
6584 with self.assertRaises(TypeError) as cm:
6585 parser.parse_intermixed_args(argv)
6586 self.assertRegex(str(cm.exception), r'\.\.\.')
6587
6588 def test_required_exclusive(self):
6589 # 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