summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-20 15:06:09 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-20 15:06:09 +0000
commit1c3e3d3dba0a833981ed39da42e0bed015400d40 (patch)
treed92e823e4bb61540c4b3b402fb1ea75f201e77e2 /tests
parentc3b13d8f03a70cb9f72dad274ac8e3026bb9aa6f (diff)
[1.2.X] Fixed #12574 -- Removed an unnecessary exception catch from the system runtest script, which could hide failing tests. Thanks to CarlFK for the report, and Ramiro Morales for the polish.
Backport of r13616 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13617 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index cd60cabc93..794f0dca94 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -122,22 +122,19 @@ def django_tests(verbosity, interactive, failfast, test_labels):
get_apps()
# Load all the test model apps.
+ test_labels_set = set([label.split('.')[0] for label in test_labels])
for model_dir, model_name in get_test_models():
model_label = '.'.join([model_dir, model_name])
- try:
- # if the model was named on the command line, or
- # no models were named (i.e., run all), import
- # this model and add it to the list to test.
- if not test_labels or model_name in set([label.split('.')[0] for label in test_labels]):
- if verbosity >= 1:
- print "Importing model %s" % model_name
- mod = load_app(model_label)
- if mod:
- if model_label not in settings.INSTALLED_APPS:
- settings.INSTALLED_APPS.append(model_label)
- except Exception, e:
- sys.stderr.write("Error while importing %s:" % model_name + ''.join(traceback.format_exception(*sys.exc_info())[1:]))
- continue
+ # if the model was named on the command line, or
+ # no models were named (i.e., run all), import
+ # this model and add it to the list to test.
+ if not test_labels or model_name in test_labels_set:
+ if verbosity >= 1:
+ print "Importing model %s" % model_name
+ mod = load_app(model_label)
+ if mod:
+ if model_label not in settings.INSTALLED_APPS:
+ settings.INSTALLED_APPS.append(model_label)
# Add tests for invalid models.
extra_tests = []