summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-02-26 12:52:01 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-02-26 12:52:01 +0000
commitf313e07b6e0914130b613c3491b2b019ca003dc7 (patch)
tree43f5d09e7637dc5f88c185a80dc057368caa4b52 /django/core
parentc27ba0b2097267796bc97daea81ee62dd10554ff (diff)
Fixed #3253 -- Exposed the number of failed tests as a return code in manage.py and runtests.py.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4608 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/core/management.py b/django/core/management.py
index ae610e696d..953eeca734 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -1240,7 +1240,10 @@ def test(app_labels, verbosity=1):
test_module = __import__(test_module_name, {}, {}, test_path[-1])
test_runner = getattr(test_module, test_path[-1])
- test_runner(app_list, verbosity)
+ failures = test_runner(app_list, verbosity)
+ if failures:
+ sys.exit(failures)
+
test.help_doc = 'Runs the test suite for the specified applications, or the entire site if no apps are specified'
test.args = '[--verbosity] ' + APP_ARGS