summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-07-23 12:14:32 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-07-23 12:14:32 +0000
commit1b7fe09660e640bd3cdbf55d340b702d951dd22e (patch)
tree61fb2561c28724599366947f52ae47d758b71f85 /django/test
parent304381616f89745c2b52ba793e5b23184c4788bb (diff)
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
Diffstat (limited to 'django/test')
-rw-r--r--django/test/simple.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/test/simple.py b/django/test/simple.py
index 9730a0df1d..08e27429e4 100644
--- a/django/test/simple.py
+++ b/django/test/simple.py
@@ -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)