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

Method test_optional

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

Source from the content-addressed store, hash-verified

6064 self.assertEqual(func(obj), result_string)
6065
6066 def test_optional(self):
6067 option = argparse.Action(
6068 option_strings=['--foo', '-a', '-b'],
6069 dest='b',
6070 type='int',
6071 nargs='+',
6072 default=42,
6073 choices=[1, 2, 3],
6074 required=False,
6075 help='HELP',
6076 metavar='METAVAR')
6077 string = (
6078 "Action(option_strings=['--foo', '-a', '-b'], dest='b', "
6079 "nargs='+', const=None, default=42, type='int', "
6080 "choices=[1, 2, 3], required=False, help='HELP', "
6081 "metavar='METAVAR', deprecated=False)")
6082 self.assertStringEqual(option, string)
6083
6084 def test_argument(self):
6085 argument = argparse.Action(

Callers

nothing calls this directly

Calls 1

assertStringEqualMethod · 0.95

Tested by

no test coverage detected