Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #297 -- Added a '--settings' option to runtests.py

git-svn-id: http://code.djangoproject.com/svn/django/trunk@463 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 151bf05850e1a5449c741aecdaafae544c6bcccf 1 parent 4622e0f
Adrian Holovaty authored August 10, 2005

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  tests/runtests.py
6  tests/runtests.py
@@ -54,6 +54,8 @@ def run_tests(self):
54 54
         from django.core.db import db
55 55
         from django.core import management, meta
56 56
 
  57
+        self.output(0, "Running tests with database %r" % settings.DATABASE_ENGINE)
  58
+
57 59
         # Manually set INSTALLED_APPS to point to the test app.
58 60
         settings.INSTALLED_APPS = (APP_NAME,)
59 61
 
@@ -176,9 +178,13 @@ def run_tests(self):
176 178
     parser = OptionParser()
177 179
     parser.add_option('-v', help='How verbose should the output be? Choices are 0, 1 and 2, where 2 is most verbose. Default is 0.',
178 180
         type='choice', choices=['0', '1', '2'])
  181
+    parser.add_option('--settings',
  182
+        help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.')
179 183
     options, args = parser.parse_args()
180 184
     verbosity_level = 0
181 185
     if options.v:
182 186
         verbosity_level = int(options.v)
  187
+    if options.settings:
  188
+        os.environ['DJANGO_SETTINGS_MODULE'] = options.settings
183 189
     t = TestRunner(verbosity_level)
184 190
     t.run_tests()

0 notes on commit 151bf05

Please sign in to comment.
Something went wrong with that request. Please try again.