From 90d4cdbac80f0f87f365efdf9b596eff77764bed Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 16 Sep 2010 11:29:01 -0400 Subject: - 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. --- test/sql/test_query.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/sql/test_query.py') 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. -- cgit v1.2.1