Mercurial > libervia-pubsub
changeset 219:bb7103da9879
Make the PostgreSQL ConnectionPool only once for all unit tests.
Author: ralphm.
Fixes: #18.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Sat, 16 Oct 2010 20:02:47 +0200 |
parents | 479fc959af0e |
children | e59b48f3f636 |
files | idavoll/test/test_storage.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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',