summaryrefslogtreecommitdiff
path: root/test/testbase.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-08-25 16:27:10 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-08-25 16:27:10 +0000
commit8260ca2723ab3b08339ec9273fa729f70862fdf3 (patch)
tree8b32cc35e8b63a16eb55e5f136888cba5d4356ea /test/testbase.py
parent367e3b61a1031e51ffd13acbc71245088f5ed15a (diff)
downloadsqlalchemy-8260ca2723ab3b08339ec9273fa729f70862fdf3.tar.gz
- 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]
Diffstat (limited to 'test/testbase.py')
-rw-r--r--test/testbase.py10
1 files changed, 7 insertions, 3 deletions
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):