1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #3771 -- Modified the test runner to observe the --noinput argument controlling script interactivity. This means that test scripts can now be put in a buildbot environment. This is a backwards incompatible change for anyone that has written a custom test runner. Thanks for the suggestion, moof@metamoof.net.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2007-07-23 12:14:32 +00:00
parent 304381616f
commit 1b7fe09660
4 changed files with 24 additions and 11 deletions

View File

@@ -69,7 +69,7 @@ def build_suite(app_module):
return suite
def run_tests(module_list, verbosity=1, extra_tests=[]):
def run_tests(module_list, verbosity=1, interactive=True, extra_tests=[]):
"""
Run the unit tests for all the modules in the provided list.
This testrunner will search each of the modules in the provided list,
@@ -91,7 +91,7 @@ def run_tests(module_list, verbosity=1, extra_tests=[]):
suite.addTest(test)
old_name = settings.DATABASE_NAME
create_test_db(verbosity)
create_test_db(verbosity, autoclobber=not interactive)
result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
destroy_test_db(old_name, verbosity)