]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Use session for exec check
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 21 Dec 2016 15:20:19 +0000 (10:20 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 21 Dec 2016 15:20:19 +0000 (10:20 -0500)
This was using a different connection which could deadlock on
SQL Server.

Change-Id: Ia7953f362c99d9247dd47c3f5c3b0b91c96db1a5

test/orm/test_unitofworkv2.py

index b2fefe6167623dc80f7f4ed9d0378d089975f2bc..651a9b9ab3f2ac945909d58b285d98a64e15372e 100644 (file)
@@ -1307,9 +1307,13 @@ class RowswitchAccountingTest(fixtures.MappedTest):
         sess.flush()
 
         eq_(
-            select([func.count('*')]).select_from(self.tables.parent).scalar(),
-            0)
+            sess.scalar(
+                select([func.count('*')]).select_from(self.tables.parent)
+            ),
+            0
+        )
 
+        sess.close()
 
 class RowswitchM2OTest(fixtures.MappedTest):
     # tests for #3060 and related issues