From d1dc39d55d111cdeffa663deec773d8bb67d237e Mon Sep 17 00:00:00 2001 From: Charles-Axel Dein Date: Mon, 8 Jun 2015 10:01:59 -0700 Subject: [PATCH] Expire session in testing transaction handling --- doc/build/orm/session_transaction.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/build/orm/session_transaction.rst b/doc/build/orm/session_transaction.rst index 24a8446501..08f11afccb 100644 --- a/doc/build/orm/session_transaction.rst +++ b/doc/build/orm/session_transaction.rst @@ -484,7 +484,9 @@ everything is rolled back. from sqlalchemy import event + class SomeTest(TestCase): + def setUp(self): # connect to the database self.connection = engine.connect() @@ -503,6 +505,6 @@ everything is rolled back. def restart_savepoint(session, transaction): if transaction.nested and not transaction._parent.nested: session.begin_nested() - + session.expire_all() # ... the tearDown() method stays the same -- 2.47.3