1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #11615 -- Changed test runners to use an exit status code of 1 for any number of failed tests. The previous behavior of using an exit status code equal to the number of failed tests produced incorrect exit status codes when the number of test failures was 256 or greater. Thanks to lamby for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gary Wilson Jr
2010-01-03 18:52:25 +00:00
parent a5fc65b46e
commit 5dd6bbd2cf
3 changed files with 19 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ class Command(BaseCommand):
def handle(self, *test_labels, **options):
from django.conf import settings
from django.test.utils import get_runner
verbosity = int(options.get('verbosity', 1))
interactive = options.get('interactive', True)
failfast = options.get('failfast', False)
@@ -25,10 +25,10 @@ class Command(BaseCommand):
# Some custom test runners won't accept the failfast flag, so let's make sure they accept it before passing it to them
if 'failfast' in test_runner.func_code.co_varnames:
failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive,
failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive,
failfast=failfast)
else:
failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive)
if failures:
sys.exit(failures)
sys.exit(bool(failures))