mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-17 06:30:26 +00:00
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:
parent
c88fbd6c75
commit
75443cd014
1 changed files with 5 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue