summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles-Axel Dein <ca@d3in.org>2015-06-08 10:01:59 -0700
committerCharles-Axel Dein <ca@d3in.org>2015-06-08 10:01:59 -0700
commitd1dc39d55d111cdeffa663deec773d8bb67d237e (patch)
tree8ecfeb3bfc54cbb089ea89c82fd02af3fa38b0ef
parent3873d7db340835a38e6b191e8466fb42c3a9d3f6 (diff)
downloadsqlalchemy-pr/180.tar.gz
Expire session in testing transaction handlingpr/180
-rw-r--r--doc/build/orm/session_transaction.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/build/orm/session_transaction.rst b/doc/build/orm/session_transaction.rst
index 24a844650..08f11afcc 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