From: jlgijsbers Date: Sun, 26 Oct 2003 14:13:04 +0000 (+0000) Subject: Add hasattr() check for backend in mysqlOpener. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=36ad31771ca75826d5e09b8f2ab49d3a22411678;p=roundup.git Add hasattr() check for backend in mysqlOpener. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1945 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/test/test_mysql.py b/test/test_mysql.py index 6e723ef..2e16e5d 100644 --- a/test/test_mysql.py +++ b/test/test_mysql.py @@ -15,18 +15,19 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_mysql.py,v 1.1 2003-10-25 22:53:26 richard Exp $ +# $Id: test_mysql.py,v 1.2 2003-10-26 14:13:04 jlgijsbers Exp $ import unittest, os, shutil, time, imp from roundup.hyperdb import DatabaseError -from roundup import init +from roundup import init, backends from db_test_base import DBTest, ROTest, config, SchemaTest, nodbconfig, \ ClassicInitTest class mysqlOpener: - from roundup.backends import mysql as module + if hasattr(backends, 'mysql'): + from roundup.backends import mysql as module def tearDown(self): self.db.close() @@ -92,8 +93,6 @@ MYSQL_DATABASE = (MYSQL_DBHOST, MYSQL_DBUSER, MYSQL_DBPASSWORD, MYSQL_DBNAME) def test_suite(): suite = unittest.TestSuite() - - from roundup import backends if not hasattr(backends, 'mysql'): return suite