Mercurial > p > roundup > code
diff test/test_mysql.py @ 2715:6ca9017b6f07 maint-0.7
connection availability check merged from HEAD
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Fri, 01 Oct 2004 09:04:13 +0000 |
| parents | b7404a96b58a |
| children |
line wrap: on
line diff
--- a/test/test_mysql.py Wed Sep 29 09:16:09 2004 +0000 +++ b/test/test_mysql.py Fri Oct 01 09:04:13 2004 +0000 @@ -14,8 +14,8 @@ # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -# -# $Id: test_mysql.py,v 1.9 2004-03-24 06:18:59 richard Exp $ +# +# $Id: test_mysql.py,v 1.9.2.1 2004-10-01 09:04:13 a1s Exp $ import unittest, os, shutil, time, imp @@ -94,12 +94,12 @@ 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() - except (MySQLdb.ProgrammingError, DatabaseError), msg: + # 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: print 'Including mysql tests' @@ -114,3 +114,4 @@ runner = unittest.TextTestRunner() unittest.main(testRunner=runner) +# vim: set et sts=4 sw=4 :
