|
|
@@ -20,14 +20,23 @@ def run_tests(*test_args):
|
|
20
|
20
|
|
|
21
|
21
|
if __name__ == '__main__':
|
|
22
|
22
|
parser = OptionParser()
|
|
23
|
|
- __, args = parser.parse_args()
|
|
|
23
|
+ parser.add_option('--with-coverage', dest='coverage', default=False,
|
|
|
24
|
+ action='store_true')
|
|
|
25
|
+ parser.add_option('--with-xunit', dest='xunit', default=False,
|
|
|
26
|
+ action='store_true')
|
|
|
27
|
+ options, args = parser.parse_args()
|
|
24
|
28
|
|
|
25
|
29
|
# If no args, then use 'progressive' plugin to keep the screen real estate
|
|
26
|
30
|
# used down to a minimum. Otherwise, use the spec plugin
|
|
27
|
31
|
nose_args = ['-s', '-x',
|
|
28
|
32
|
'--with-progressive' if not args else '--with-spec']
|
|
29
|
|
- #nose_args.extend([
|
|
30
|
|
- # '--with-coverage', '--cover-package=oscar', '--cover-html',
|
|
31
|
|
- # '--cover-html-dir=htmlcov'])
|
|
|
33
|
+
|
|
|
34
|
+ if options.coverage:
|
|
|
35
|
+ # Nose automatically uses any options passed to runtests.py, which is
|
|
|
36
|
+ # why the coverage trigger uses '--with-coverage' and why we don't need
|
|
|
37
|
+ # to explicitly include it here.
|
|
|
38
|
+ nose_args.extend([
|
|
|
39
|
+ '--cover-package=oscar', '--cover-html',
|
|
|
40
|
+ '--cover-html-dir=htmlcov'])
|
|
32
|
41
|
configure(nose_args)
|
|
33
|
42
|
run_tests(*args)
|