summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-05-29 02:11:14 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-05-29 02:11:14 +0000
commita88dfca37a367e77de9bfb868311a940a359fd48 (patch)
treee610b3dbcd13c6a8a36834b6be84d6998bda20b5
parent4b8897902105379a97363a0f3d58f1e87e65b42b (diff)
downloadsqlalchemy-a88dfca37a367e77de9bfb868311a940a359fd48.tar.gz
unit test adjustments to insure weakref status on connecitonfairy
-rw-r--r--test/pool.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/pool.py b/test/pool.py
index d8c984aa8..9a8c7cffd 100644
--- a/test/pool.py
+++ b/test/pool.py
@@ -126,7 +126,9 @@ class PoolTest(PersistTest):
c2.close()
else:
c2 = None
-
+
+ c3 = None
+
if useclose:
c1 = p.connect()
c2 = p.connect()
@@ -134,7 +136,23 @@ class PoolTest(PersistTest):
c3.close()
c2.close()
self.assert_(c1.connection is not None)
-
+ c1.close()
+ else:
+ c1 = c2 = c3 = None
+
+ # extra tests with QueuePool to insure connections get __del__()ed when dereferenced
+ if isinstance(p, pool.QueuePool):
+ self.assert_(p.checkedout() == 0)
+ c1 = p.connect()
+ c2 = p.connect()
+ if useclose:
+ c2.close()
+ c1.close()
+ else:
+ c2 = None
+ c1 = None
+ self.assert_(p.checkedout() == 0)
+
def tearDown(self):
pool.clear_managers()
for file in ('foo.db', 'bar.db'):