Changeset 5788 for django/branches/schema-evolution/tests/runtests.py
- Timestamp:
- 08/02/07 16:51:32 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/schema-evolution/tests/runtests.py
r5734 r5788 74 74 self.assert_(not missing, "Missing Errors: " + '\n'.join(missing)) 75 75 76 def django_tests(verbosity, tests_to_run):76 def django_tests(verbosity, interactive, test_labels): 77 77 from django.conf import settings 78 78 … … 110 110 # no models were named (i.e., run all), import 111 111 # this model and add it to the list to test. 112 if not test s_to_run or model_name in tests_to_run:112 if not test_labels or model_name in set([label.split('.')[0] for label in test_labels]): 113 113 if verbosity >= 1: 114 114 print "Importing model %s" % model_name … … 117 117 if model_label not in settings.INSTALLED_APPS: 118 118 settings.INSTALLED_APPS.append(model_label) 119 test_models.append(mod)120 119 except Exception, e: 121 120 sys.stderr.write("Error while importing %s:" % model_name + ''.join(traceback.format_exception(*sys.exc_info())[1:])) … … 126 125 for model_dir, model_name in get_invalid_models(): 127 126 model_label = '.'.join([model_dir, model_name]) 128 if not test s_to_run or model_name in tests_to_run:127 if not test_labels or model_name in test_labels: 129 128 extra_tests.append(InvalidModelTestCase(model_label)) 130 129 131 130 # Run the test suite, including the extra validation tests. 132 131 from django.test.simple import run_tests 133 failures = run_tests(test_ models, verbosity, extra_tests=extra_tests)132 failures = run_tests(test_labels, verbosity=verbosity, interactive=interactive, extra_tests=extra_tests) 134 133 if failures: 135 134 sys.exit(failures) … … 150 149 type='choice', choices=['0', '1', '2'], 151 150 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output') 151 parser.add_option('--noinput', action='store_false', dest='interactive', default=True, 152 help='Tells Django to NOT prompt the user for input of any kind.') 152 153 parser.add_option('--settings', 153 154 help='Python path to settings module, e.g. "myproject.settings". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') … … 158 159 parser.error("DJANGO_SETTINGS_MODULE is not set in the environment. " 159 160 "Set it or use --settings.") 160 django_tests(int(options.verbosity), args)161 django_tests(int(options.verbosity), options.interactive, args)
