Skip to content

Commit e7e991e

Browse files
Fixed #964 -- Added helpful error message if there's a problem in running the unit tests. Thanks, paolo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 3bf29d2 commit e7e991e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/runtests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ def run_tests(self):
100100
self.output(1, "Creating test database")
101101
try:
102102
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)
105106
if confirm == 'yes':
106107
cursor.execute("DROP DATABASE %s" % TEST_DATABASE_NAME)
107108
cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)

0 commit comments

Comments
 (0)