Properly set the exit code when running tests

run_tests returns the number of failed tests.  Supplying this number
to sys.exit lets other programs know if there were any test failures.

Also, run the tests with the default verbosity.
This commit is contained in:
Eric Davis 2011-09-17 11:26:19 -07:00
parent c88fbd6c75
commit 75443cd014

View file

@ -105,10 +105,13 @@ class override_settings(object):
def run_tests():
"""
Use the Django test runner to run the tests.
Sets the return code to the number of failed tests.
"""
import sys
from django.test.simple import DjangoTestSuiteRunner
runner = DjangoTestSuiteRunner(verbosity=2)
runner.run_tests(None)
runner = DjangoTestSuiteRunner()
sys.exit(runner.run_tests(["analytical"]))
def with_apps(*apps):