From bebf30e34d669a5ede54e512e55ee5186fe015f6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 13 Jan 2014 03:22:11 -0500 Subject: - continue with [ticket:2907] and further clean up how we set up _reset_agent, so that it's local to the various begin_impl(), rollback_impl(), etc. this allows setting/resetting of the flag to be symmetric. - don't set _reset_agent if it's not None, don't unset it if it isn't our own transaction. - make sure we clean it out in close(). - basically, we're dealing here with pools using "threadlocal" that have a counter, other various mismatches that the tests bring up - test for recover() now has to invalidate() the previous connection, because closing it actually rolls it back (e.g. this test was relying on the broken behavior). --- test/engine/test_transaction.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py index e3f5fc252..c373133d1 100644 --- a/test/engine/test_transaction.py +++ b/test/engine/test_transaction.py @@ -342,7 +342,8 @@ class TransactionTest(fixtures.TestBase): transaction = connection.begin_twophase() connection.execute(users.insert(), user_id=1, user_name='user1') transaction.prepare() - connection.close() + connection.invalidate() + connection2 = testing.db.connect() eq_(connection2.execute(select([users.c.user_id]). order_by(users.c.user_id)).fetchall(), -- cgit v1.2.1