diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-02-26 12:52:01 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-02-26 12:52:01 +0000 |
| commit | f313e07b6e0914130b613c3491b2b019ca003dc7 (patch) | |
| tree | 43f5d09e7637dc5f88c185a80dc057368caa4b52 /django/test | |
| parent | c27ba0b2097267796bc97daea81ee62dd10554ff (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/test')
| -rw-r--r-- | django/test/simple.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/test/simple.py b/django/test/simple.py index 0cecc6b4fc..200f150594 100644 --- a/django/test/simple.py +++ b/django/test/simple.py @@ -63,6 +63,8 @@ def run_tests(module_list, verbosity=1, extra_tests=[]): looking for doctests and unittests in models.py or tests.py within the module. A list of 'extra' tests may also be provided; these tests will be added to the test suite. + + Returns the number of tests that failed. """ setup_test_environment() @@ -77,7 +79,10 @@ def run_tests(module_list, verbosity=1, extra_tests=[]): old_name = settings.DATABASE_NAME create_test_db(verbosity) - unittest.TextTestRunner(verbosity=verbosity).run(suite) + result = unittest.TextTestRunner(verbosity=verbosity).run(suite) destroy_test_db(old_name, verbosity) teardown_test_environment() + + return len(result.failures) +
\ No newline at end of file |
