diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-07-27 04:08:53 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-07-27 04:08:53 +0000 |
commit | ed4fc64bb0ac61c27bc4af32962fb129e74a36bf (patch) | |
tree | c1cf2fb7b1cafced82a8898e23d2a0bf5ced8526 /test/engine/reconnect.py | |
parent | 3a8e235af64e36b3b711df1f069d32359fe6c967 (diff) | |
download | sqlalchemy-ed4fc64bb0ac61c27bc4af32962fb129e74a36bf.tar.gz |
merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3.
Diffstat (limited to 'test/engine/reconnect.py')
-rw-r--r-- | test/engine/reconnect.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/engine/reconnect.py b/test/engine/reconnect.py index defc878ab..7c213695f 100644 --- a/test/engine/reconnect.py +++ b/test/engine/reconnect.py @@ -1,6 +1,8 @@ import testbase +import sys, weakref from sqlalchemy import create_engine, exceptions -import gc, weakref, sys +from testlib import * + class MockDisconnect(Exception): pass @@ -37,7 +39,7 @@ class MockCursor(object): def close(self): pass -class ReconnectTest(testbase.PersistTest): +class ReconnectTest(PersistTest): def test_reconnect(self): """test that an 'is_disconnect' condition will invalidate the connection, and additionally dispose the previous connection pool and recreate.""" @@ -50,7 +52,7 @@ class ReconnectTest(testbase.PersistTest): # monkeypatch disconnect checker db.dialect.is_disconnect = lambda e: isinstance(e, MockDisconnect) - pid = id(db.connection_provider._pool) + pid = id(db.pool) # make a connection conn = db.connect() @@ -81,7 +83,7 @@ class ReconnectTest(testbase.PersistTest): # close shouldnt break conn.close() - assert id(db.connection_provider._pool) != pid + assert id(db.pool) != pid # ensure all connections closed (pool was recycled) assert len(dbapi.connections) == 0 @@ -92,4 +94,4 @@ class ReconnectTest(testbase.PersistTest): assert len(dbapi.connections) == 1 if __name__ == '__main__': - testbase.main()
\ No newline at end of file + testbase.main() |