From 8260ca2723ab3b08339ec9273fa729f70862fdf3 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 25 Aug 2006 16:27:10 +0000 Subject: - cleanup on connection methods + documentation. custom DBAPI arguments specified in query string, 'connect_args' argument to 'create_engine', or custom creation function via 'creator' function to 'create_engine'. - added "recycle" argument to Pool, is "pool_recycle" on create_engine, defaults to 3600 seconds; connections after this age will be closed and replaced with a new one, to handle db's that automatically close stale connections [ticket:274] --- test/testbase.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/testbase.py') diff --git a/test/testbase.py b/test/testbase.py index ddec64179..041b87700 100644 --- a/test/testbase.py +++ b/test/testbase.py @@ -146,18 +146,22 @@ class PersistTest(unittest.TestCase): class MockPool(pool.Pool): """this pool is hardcore about only one connection being used at a time.""" def __init__(self, creator, **params): - pool.Pool.__init__(self, **params) - self.connection = creator() + pool.Pool.__init__(self, creator, **params) + self.connection = pool._ConnectionRecord(self) self._conn = self.connection def status(self): return "MockPool" + def create_connection(self): + raise "Invalid" + def do_return_conn(self, conn): assert conn is self._conn and self.connection is None self.connection = conn - def do_return_invalid(self): + def do_return_invalid(self, conn): + pass raise "Invalid" def do_get(self): -- cgit v1.2.1