summaryrefslogtreecommitdiff
path: root/test/sql/test_query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-09-16 11:29:01 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-09-16 11:29:01 -0400
commit90d4cdbac80f0f87f365efdf9b596eff77764bed (patch)
tree98dacaa14d1aa9906546684af5f848f0a5c81e23 /test/sql/test_query.py
parentb609030130eb4c415deee5516e2450ed660f2717 (diff)
downloadsqlalchemy-90d4cdbac80f0f87f365efdf9b596eff77764bed.tar.gz
- Fixed a regression in 0.6.4 whereby the change that
allowed cursor errors to be raised consistently broke the result.lastrowid accessor. Test coverage has been added for result.lastrowid. Note that lastrowid is only supported by Pysqlite and some MySQL drivers, so isn't super-useful in the general case.
Diffstat (limited to 'test/sql/test_query.py')
-rw-r--r--test/sql/test_query.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 2093e1f69..57f434a98 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -619,6 +619,16 @@ class QueryTest(TestBase):
eq_(r[users.c.user_name], 'jack')
eq_(r.user_name, 'jack')
+ @testing.requires.dbapi_lastrowid
+ def test_native_lastrowid(self):
+ r = testing.db.execute(
+ users.insert(),
+ {'user_id':1, 'user_name':'ed'}
+ )
+
+ eq_(r.lastrowid, 1)
+
+
def test_graceful_fetch_on_non_rows(self):
"""test that calling fetchone() etc. on a result that doesn't
return rows fails gracefully.