Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #12574 -- Removed an unnecessary exception catch from the syste…

…m runtest script, which could hide failing tests. Thanks to CarlFK for the report, and Ramiro Morales for the polish.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d33736b3ee267156cc91b6a4ebf0e2f0a1b162cc 1 parent 1bf25e9
@freakboy3742 freakboy3742 authored
Showing with 11 additions and 14 deletions.
  1. +11 −14 tests/runtests.py
View
25 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 >= 2:
- 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 >= 2:
+ 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 = []
Please sign in to comment.
Something went wrong with that request. Please try again.