Skip to content
Browse files

ignore testPooling when DBUtils module is not available.

  • Loading branch information...
1 parent b3145a5 commit b0df4ed6a1bd6f2d52f43869c60fb529751959f2 @anandology anandology committed May 31, 2009
Showing with 10 additions and 1 deletion.
  1. +10 −1 test/db.py
View
11 test/db.py
@@ -77,6 +77,11 @@ def testNestedTransactions(self):
self.assertRows(2)
def testPooling(self):
+ # can't test pooling if DBUtils is not installed
+ try:
+ import DBUtils
+ except ImportError:
+ return
db = webtest.setup_database(self.dbname, pooling=True)
self.assertEquals(db.ctx.db.__class__.__module__, 'DBUtils.PooledDB')
db.select('person', limit=1)
@@ -146,8 +151,12 @@ def is_test(cls):
for t in globals().values():
if is_test(t) and not t('_testable')._testable():
del globals()[t.__name__]
-
del t
+try:
+ import DBUtils
+except ImportError, e:
+ print >> web.debug, str(e) + "(ignoring testPooling)"
+
if __name__ == '__main__':
webtest.main()

0 comments on commit b0df4ed

Please sign in to comment.
Something went wrong with that request. Please try again.