Fix option handling of the unittest runner.
This commit is contained in:
parent
4c4fe501d6
commit
9f52881d6e
2 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,9 @@ import os.path
|
||||||
import getopt
|
import getopt
|
||||||
|
|
||||||
use_x = True
|
use_x = True
|
||||||
opts, args = getopt.getopt(sys.argv[1:], 'n', ['no-x'])
|
shortargs = 'hnv:'
|
||||||
|
longargs = 'help no-x verbose='
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], shortargs, longargs.split())
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o in ('-n', '--no-x'):
|
if o in ('-n', '--no-x'):
|
||||||
use_x = False
|
use_x = False
|
||||||
|
|
|
@ -25,6 +25,7 @@ for o, a in opts:
|
||||||
verbose = int(a)
|
verbose = int(a)
|
||||||
except:
|
except:
|
||||||
print 'verbose must be a number >= 0'
|
print 'verbose must be a number >= 0'
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
# new test modules need to be added manually
|
# new test modules need to be added manually
|
||||||
modules = ( 'test_caps',
|
modules = ( 'test_caps',
|
||||||
|
|
Loading…
Add table
Reference in a new issue