Skip to content

Commit 6db8aba

Browse files
author
Johannes Gijsbers
committed
Add hasattr() check for backend in mysqlOpener.
1 parent 08fb574 commit 6db8aba

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/test_mysql.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: test_mysql.py,v 1.1 2003-10-25 22:53:26 richard Exp $
18+
# $Id: test_mysql.py,v 1.2 2003-10-26 14:13:04 jlgijsbers Exp $
1919

2020
import unittest, os, shutil, time, imp
2121

2222
from roundup.hyperdb import DatabaseError
23-
from roundup import init
23+
from roundup import init, backends
2424

2525
from db_test_base import DBTest, ROTest, config, SchemaTest, nodbconfig, \
2626
ClassicInitTest
2727

2828
class mysqlOpener:
29-
from roundup.backends import mysql as module
29+
if hasattr(backends, 'mysql'):
30+
from roundup.backends import mysql as module
3031

3132
def tearDown(self):
3233
self.db.close()
@@ -92,8 +93,6 @@ def tearDown(self):
9293

9394
def test_suite():
9495
suite = unittest.TestSuite()
95-
96-
from roundup import backends
9796
if not hasattr(backends, 'mysql'):
9897
return suite
9998

0 commit comments

Comments
 (0)