From: Mike Bayer Date: Mon, 29 May 2006 02:11:14 +0000 (+0000) Subject: unit test adjustments to insure weakref status on connecitonfairy X-Git-Tag: rel_0_2_1~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a88dfca37a367e77de9bfb868311a940a359fd48;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git unit test adjustments to insure weakref status on connecitonfairy --- diff --git a/test/pool.py b/test/pool.py index d8c984aa83..9a8c7cffdc 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'):