Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #964 -- Added helpful error message if there's a problem in run…

…ning the unit tests. Thanks, paolo.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
commit e7e991e86b9f4a3e4e89bcbc08dec32606538250 1 parent 3bf29d2
Adrian Holovaty authored December 01, 2005

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  tests/runtests.py
5  tests/runtests.py
@@ -100,8 +100,9 @@ def run_tests(self):
100 100
             self.output(1, "Creating test database")
101 101
             try:
102 102
                 cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)
103  
-            except:
104  
-                confirm = raw_input("The test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_DATABASE_NAME)
  103
+            except Exception, e:
  104
+                sys.stderr.write("Got an error creating the test database: %s\n" % e)
  105
+                confirm = raw_input("It appears the test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_DATABASE_NAME)
105 106
                 if confirm == 'yes':
106 107
                     cursor.execute("DROP DATABASE %s" % TEST_DATABASE_NAME)
107 108
                     cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)

0 notes on commit e7e991e

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