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

Method test_failures_when_required

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

Source from the content-addressed store, hash-verified

3442 self.assertRaises(error, parse_args, args_string.split())
3443
3444 def test_failures_when_required(self):
3445 parse_args = self.get_parser(required=True).parse_args
3446 error = ArgumentParserError
3447 for args_string in self.failures + ['']:
3448 with self.subTest(args=args_string):
3449 self.assertRaises(error, parse_args, args_string.split())
3450
3451 def test_successes_when_not_required(self):
3452 parse_args = self.get_parser(required=False).parse_args

Callers

nothing calls this directly

Calls 4

get_parserMethod · 0.45
subTestMethod · 0.45
assertRaisesMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected