summaryrefslogtreecommitdiff
path: root/django/core
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/core
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/core')
-rw-r--r--django/core/management.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/django/core/management.py b/django/core/management.py
index 4c68417517..4862a7833f 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -1331,7 +1331,7 @@ def runfcgi(args):
runfastcgi(args)
runfcgi.args = '[various KEY=val options, use `runfcgi help` for help]'
-def test(app_labels, verbosity=1):
+def test(app_labels, verbosity=1, interactive=True):
"Runs the test suite for the specified applications"
from django.conf import settings
from django.db.models import get_app, get_apps
@@ -1350,12 +1350,12 @@ def test(app_labels, verbosity=1):
test_module = __import__(test_module_name, {}, {}, test_path[-1])
test_runner = getattr(test_module, test_path[-1])
- failures = test_runner(app_list, verbosity)
+ failures = test_runner(app_list, verbosity=verbosity, interactive=interactive)
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
+test.args = '[--verbosity] [--noinput]' + APP_ARGS
def load_data(fixture_labels, verbosity=1):
"Installs the provided fixture file(s) as data in the database."
@@ -1631,7 +1631,12 @@ def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
action_mapping[action](args[1])
except IndexError:
parser.print_usage_and_exit()
- elif action in ('test', 'loaddata'):
+ elif action == 'test':
+ try:
+ action_mapping[action](args[1:], int(options.verbosity), options.interactive)
+ except IndexError:
+ parser.print_usage_and_exit()
+ elif action == 'loaddata':
try:
action_mapping[action](args[1:], int(options.verbosity))
except IndexError: