From 07fa03dde4b027f9add2735f2c12907894631318 Mon Sep 17 00:00:00 2001 From: Gary Wilson Jr Date: Sun, 3 Jan 2010 18:57:15 +0000 Subject: [PATCH] [1.1.X] 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. Backport of r12068 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12069 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/test.py | 2 +- tests/runtests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/core/management/commands/test.py b/django/core/management/commands/test.py index 8ebf3daea6..21e1e5189a 100644 --- a/django/core/management/commands/test.py +++ b/django/core/management/commands/test.py @@ -22,4 +22,4 @@ class Command(BaseCommand): failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive) if failures: - sys.exit(failures) + sys.exit(bool(failures)) diff --git a/tests/runtests.py b/tests/runtests.py index f556246c90..b461717aa6 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -160,7 +160,7 @@ def django_tests(verbosity, interactive, test_labels): failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive, extra_tests=extra_tests) if failures: - sys.exit(failures) + sys.exit(bool(failures)) # Restore the old settings. settings.INSTALLED_APPS = old_installed_apps