]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixed test for #1175
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Oct 2008 00:24:43 +0000 (00:24 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Oct 2008 00:24:43 +0000 (00:24 +0000)
test/engine/execute.py

index e449af9ad002552edc35097aebbe24eae502a420..85a99c45241408cbd3e31e099ed34d321fca4b8c 100644 (file)
@@ -2,7 +2,7 @@ import testenv; testenv.configure_for_tests()
 import re
 from sqlalchemy.interfaces import ConnectionProxy
 from testlib.sa import MetaData, Table, Column, Integer, String, INT, \
-     VARCHAR, func
+     VARCHAR, func, bindparam
 import testlib.sa as tsa
 from testlib import TestBase, testing, engines
 
@@ -79,11 +79,10 @@ class ExecuteTest(TestBase):
                 assert True
 
     def test_empty_insert(self):
-        try:
-            result = testing.db.execute(users.insert(), [])
-            assert [] == list(result)
-        except:
-            assert False
+        """test that execute() interprets [] as a list with no params"""
+        
+        result = testing.db.execute(users.insert().values(user_name=bindparam('name')), [])
+        assert result.rowcount == 1
 
 class ProxyConnectionTest(TestBase):
     @testing.fails_on('firebird') # Data type unknown