Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 88c84cc7d0
Fetching contributors…

Cannot retrieve contributors at this time

executable file 41 lines (33 sloc) 1.203 kB
#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from coverage import coverage
import tests.config
from django.test.simple import DjangoTestSuiteRunner
logging.disable(logging.CRITICAL)
def run_tests(verbosity, *test_args):
test_runner = DjangoTestSuiteRunner(verbosity=verbosity)
if not test_args:
test_args = ['oscar']
num_failures = test_runner.run_tests(test_args)
if num_failures:
sys.exit(num_failures)
if __name__ == '__main__':
parser = OptionParser()
parser.add_option('-c', '--coverage', dest='use_coverage', default=False,
action='store_true', help="Generate coverage report")
parser.add_option('-v', '--verbosity', dest='verbosity', default=1,
type='int', help="Verbosity of output")
(options, args) = parser.parse_args()
if options.use_coverage:
print 'Running tests with coverage'
c = coverage(source=['oscar'])
c.start()
run_tests(options.verbosity, *args)
c.stop()
print 'Generate HTML reports'
c.html_report()
else:
print 'Running tests'
run_tests(options.verbosity, *args)
Jump to Line
Something went wrong with that request. Please try again.