diff options
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 |
