# HG changeset patch # User Ralph Meijer # Date 1287252167 -7200 # Node ID bb7103da9879ca2ce3d591f8bf1227679decf708 # Parent 479fc959af0e2a5a5f03be99b8688cfdb4cdcec5 Make the PostgreSQL ConnectionPool only once for all unit tests. Author: ralphm. Fixes: #18. diff -r 479fc959af0e -r bb7103da9879 idavoll/test/test_storage.py --- a/idavoll/test/test_storage.py Wed Oct 14 16:13:24 2009 +0000 +++ b/idavoll/test/test_storage.py Sat Oct 16 20:02:47 2010 +0200 @@ -11,8 +11,6 @@ from twisted.internet import defer from twisted.words.xish import domish -from wokkel import pubsub - from idavoll import error, iidavoll OWNER = jid.JID('owner@example.com') @@ -447,10 +445,13 @@ class PgsqlStorageStorageTestCase(unittest.TestCase, StorageTests): + dbpool = None + def setUp(self): from idavoll.pgsql_storage import Storage from twisted.enterprise import adbapi - self.dbpool = adbapi.ConnectionPool('pyPgSQL.PgSQL', + if self.dbpool is None: + self.__class__.dbpool = adbapi.ConnectionPool('pyPgSQL.PgSQL', database='pubsub_test', cp_reconnect=True, client_encoding='utf-8',