test_runner.py: improve test coverage a little bit

This commit is contained in:
Brian Warner
2007-04-23 21:28:19 -07:00
parent e7a41aa9f7
commit 813fdd70da
2 changed files with 42 additions and 1 deletions

View File

@ -95,11 +95,13 @@ class Options(usage.Options):
if not hasattr(self, 'subOptions'):
raise usage.UsageError("must specify a command")
def runner(argv):
def runner(argv, run_by_human=True):
config = Options()
try:
config.parseOptions(argv)
except usage.error, e:
if not run_by_human:
raise
print "%s: %s" % (sys.argv[0], e)
print
c = getattr(config, 'subOptions', config)