]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- other test fixes
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Aug 2014 04:19:57 +0000 (00:19 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Aug 2014 04:19:57 +0000 (00:19 -0400)
lib/sqlalchemy/engine/base.py
test/orm/test_naturalpks.py

index 65753b6dcf07b3d258325777cbe48014f6063276..3728b59fd04cf04989d1961d3aec5f044dd99f97 100644 (file)
@@ -799,7 +799,7 @@ class Connection(Connectable):
         if distilled_params:
             # note this is usually dict but we support RowProxy
             # as well; but dict.keys() as an iterator is OK
-            keys = distilled_params[0].keys()
+            keys = list(distilled_params[0].keys())
         else:
             keys = []
 
index 53b661a49b6a26e4e664ac15dafbaadff05faac0..a4e982f84bdad662fa1f8d2b641dbda389fcf0b5 100644 (file)
@@ -184,7 +184,7 @@ class NaturalPKTest(fixtures.MappedTest):
         if not passive_updates:
             # test passive_updates=False;
             #load addresses, update user, update 2 addresses
-            self.assert_sql_count(testing.db, go, 4)
+            self.assert_sql_count(testing.db, go, 3)
         else:
             # test passive_updates=True; update user
             self.assert_sql_count(testing.db, go, 1)
@@ -239,7 +239,7 @@ class NaturalPKTest(fixtures.MappedTest):
 
         def go():
             sess.flush()
-        self.assert_sql_count(testing.db, go, 3)
+        self.assert_sql_count(testing.db, go, 2)
 
     def _test_manytoone(self, passive_updates):
         users, Address, addresses, User = (self.tables.users,
@@ -270,7 +270,7 @@ class NaturalPKTest(fixtures.MappedTest):
         if passive_updates:
             self.assert_sql_count(testing.db, go, 1)
         else:
-            self.assert_sql_count(testing.db, go, 3)
+            self.assert_sql_count(testing.db, go, 2)
 
         def go():
             sess.flush()
@@ -366,7 +366,8 @@ class NaturalPKTest(fixtures.MappedTest):
         if passive_updates:
             self.assert_sql_count(testing.db, go, 1)
         else:
-            self.assert_sql_count(testing.db, go, 3)
+            # two updates bundled
+            self.assert_sql_count(testing.db, go, 2)
         eq_([Address(username='ed'), Address(username='ed')], [ad1, ad2])
         sess.expunge_all()
         eq_(
@@ -383,7 +384,8 @@ class NaturalPKTest(fixtures.MappedTest):
         if passive_updates:
             self.assert_sql_count(testing.db, go, 1)
         else:
-            self.assert_sql_count(testing.db, go, 3)
+            # two updates bundled
+            self.assert_sql_count(testing.db, go, 2)
         sess.expunge_all()
         eq_(
             [Address(username='fred'), Address(username='fred')],
@@ -789,8 +791,8 @@ class NonPKCascadeTest(fixtures.MappedTest):
             sess.flush()
         if not passive_updates:
             # test passive_updates=False; load addresses,
-            #  update user, update 2 addresses
-            self.assert_sql_count(testing.db, go, 4)
+            #  update user, update 2 addresses (in one executemany)
+            self.assert_sql_count(testing.db, go, 3)
         else:
             # test passive_updates=True; update user
             self.assert_sql_count(testing.db, go, 1)