|
|
@@ -4,18 +4,16 @@ import logging
|
|
4
|
4
|
from optparse import OptionParser
|
|
5
|
5
|
from coverage import coverage
|
|
6
|
6
|
|
|
7
|
|
-# This configures the settings
|
|
8
|
7
|
from tests.config import configure
|
|
9
|
|
-configure()
|
|
10
|
|
-
|
|
11
|
|
-from django_nose import NoseTestSuiteRunner
|
|
12
|
8
|
|
|
13
|
9
|
logging.disable(logging.CRITICAL)
|
|
14
|
10
|
|
|
15
|
11
|
|
|
16
|
12
|
def run_tests(options, *test_args):
|
|
|
13
|
+ from django_nose import NoseTestSuiteRunner
|
|
17
|
14
|
test_runner = NoseTestSuiteRunner(verbosity=options.verbosity,
|
|
18
|
|
- pdb=options.pdb)
|
|
|
15
|
+ pdb=options.pdb,
|
|
|
16
|
+ )
|
|
19
|
17
|
if not test_args:
|
|
20
|
18
|
test_args = ['tests']
|
|
21
|
19
|
num_failures = test_runner.run_tests(test_args)
|
|
|
@@ -33,6 +31,12 @@ if __name__ == '__main__':
|
|
33
|
31
|
action='store_true', help="Whether to drop into PDB on failure/error")
|
|
34
|
32
|
(options, args) = parser.parse_args()
|
|
35
|
33
|
|
|
|
34
|
+ # If no args, then use 'progressive' plugin to keep the screen real estate
|
|
|
35
|
+ # used down to a minimum. Otherwise, use the spec plugin
|
|
|
36
|
+ nose_args = ['-s', '-x',
|
|
|
37
|
+ '--with-progressive' if not args else '--with-spec']
|
|
|
38
|
+ configure(nose_args)
|
|
|
39
|
+
|
|
36
|
40
|
if options.use_coverage:
|
|
37
|
41
|
print 'Running tests with coverage'
|
|
38
|
42
|
c = coverage(source=['oscar'])
|