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

Method setUp

Lib/test/test_optparse.py:922–929  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

920
921class TestMultipleArgsAppend(BaseTest):
922 def setUp(self):
923 self.parser = InterceptingOptionParser(usage=SUPPRESS_USAGE)
924 self.parser.add_option("-p", "--point", action="store", nargs=3,
925 type="float", dest="point")
926 self.parser.add_option("-f", "--foo", action="append", nargs=2,
927 type="int", dest="foo")
928 self.parser.add_option("-z", "--zero", action="append_const",
929 dest="foo", const=(0, 0))
930
931 def test_nargs_append(self):
932 self.assertParseOK(["-f", "4", "-3", "blah", "--foo", "1", "666"],

Callers

nothing calls this directly

Calls 2

add_optionMethod · 0.45

Tested by

no test coverage detected