changeset 2694:91fdaaf8d929

use mysql.db_exists() instead of mysql.Database to test connection availability: mysql.Database requires existing roundup database to connect.
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Sun, 26 Sep 2004 15:18:28 +0000
parents 59ea85d47d34
children c26716932ffe
files test/test_mysql.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_mysql.py	Sun Sep 26 15:16:02 2004 +0000
+++ b/test/test_mysql.py	Sun Sep 26 15:18:28 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 #
-# $Id: test_mysql.py,v 1.12 2004-09-26 11:30:56 a1s Exp $
+# $Id: test_mysql.py,v 1.13 2004-09-26 15:18:28 a1s Exp $
 
 import unittest, os, shutil, time, imp
 
@@ -79,11 +79,11 @@
         return suite
 
     from roundup.backends import mysql
+    import MySQLdb
     try:
-        # Check if we can run mysql tests
-        import MySQLdb
-        db = mysql.Database(config, 'admin')
-        db.close()
+        # Check if we can connect to the server.
+        # use db_exists() to make a connection, ignore it's return value
+        mysql.db_exists(config)
     except (MySQLdb.MySQLError, DatabaseError), msg:
         print "Skipping mysql tests (%s)"%msg
     else:

Roundup Issue Tracker: http://roundup-tracker.org/