From e7e991e86b9f4a3e4e89bcbc08dec32606538250 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 1 Dec 2005 06:39:39 +0000 Subject: [PATCH] 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 --- tests/runtests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/runtests.py b/tests/runtests.py index fbe20807ce..30e1cd403b 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -100,8 +100,9 @@ class TestRunner: self.output(1, "Creating test database") try: cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME) - except: - confirm = raw_input("The test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_DATABASE_NAME) + except Exception, e: + sys.stderr.write("Got an error creating the test database: %s\n" % e) + confirm = raw_input("It appears the test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_DATABASE_NAME) if confirm == 'yes': cursor.execute("DROP DATABASE %s" % TEST_DATABASE_NAME) cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)