summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-08-15 00:19:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-08-15 00:19:57 -0400
commitb0411e80df13d347104a60c512aeb18b6479bb12 (patch)
treeed89d223058450a78b89c2733cc4f2112c1f9e3c
parentb952d892d690ec808829aede84769b2bf089f94d (diff)
downloadsqlalchemy-b0411e80df13d347104a60c512aeb18b6479bb12.tar.gz
- other test fixes
-rw-r--r--lib/sqlalchemy/engine/base.py2
-rw-r--r--test/orm/test_naturalpks.py16
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 65753b6dc..3728b59fd 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -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 = []
diff --git a/test/orm/test_naturalpks.py b/test/orm/test_naturalpks.py
index 53b661a49..a4e982f84 100644
--- a/test/orm/test_naturalpks.py
+++ b/test/orm/test_naturalpks.py
@@ -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)