Django

Code

Changeset 1520

Show
Ignore:
Timestamp:
12/01/05 00:39:39 (3 years ago)
Author:
adrian
Message:

Fixed #964 -- Added helpful error message if there's a problem in running the unit tests. Thanks, paolo.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/runtests.py

    r805 r1520  
    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)