]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Expire session in testing transaction handling
authorCharles-Axel Dein <ca@d3in.org>
Mon, 8 Jun 2015 17:01:59 +0000 (10:01 -0700)
committerCharles-Axel Dein <ca@d3in.org>
Mon, 8 Jun 2015 17:01:59 +0000 (10:01 -0700)
doc/build/orm/session_transaction.rst

index 24a8446501fedff6076a8403751a1a3aaf0d5157..08f11afccb01a3aed675a0b1acaf312930bb2bf5 100644 (file)
@@ -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