(self, columns)
| 1483 | self.parser = self.make_parser(80) |
| 1484 | |
| 1485 | def make_parser(self, columns): |
| 1486 | options = [ |
| 1487 | make_option("-a", type="string", dest='a', |
| 1488 | metavar="APPLE", help="throw APPLEs at basket"), |
| 1489 | make_option("-b", "--boo", type="int", dest='boo', |
| 1490 | metavar="NUM", |
| 1491 | help= |
| 1492 | "shout \"boo!\" NUM times (in order to frighten away " |
| 1493 | "all the evil spirits that cause trouble and mayhem)"), |
| 1494 | make_option("--foo", action="append", type="string", dest='foo', |
| 1495 | help="store FOO in the foo list for later fooing"), |
| 1496 | ] |
| 1497 | |
| 1498 | # We need to set COLUMNS for the OptionParser constructor, but |
| 1499 | # we must restore its original value -- otherwise, this test |
| 1500 | # screws things up for other tests when it's part of the Python |
| 1501 | # test suite. |
| 1502 | with os_helper.EnvironmentVarGuard() as env: |
| 1503 | env['COLUMNS'] = str(columns) |
| 1504 | return InterceptingOptionParser(option_list=options) |
| 1505 | |
| 1506 | def assertHelpEquals(self, expected_output): |
| 1507 | save_argv = sys.argv[:] |
no test coverage detected