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

Method _test_required_subparsers

Lib/test/test_argparse.py:2744–2750  ·  view source on GitHub ↗
(self, parser)

Source from the content-addressed store, hash-verified

2742 parser.parse_args('1 2'.split()))
2743
2744 def _test_required_subparsers(self, parser):
2745 # Should parse the sub command
2746 ret = parser.parse_args(['run'])
2747 self.assertEqual(ret.command, 'run')
2748
2749 # Error when the command is missing
2750 self.assertArgumentParserError(parser.parse_args, ())
2751
2752 def test_required_subparsers_via_attribute(self):
2753 parser = ErrorRaisingArgumentParser()

Calls 3

parse_argsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected