From: Jason Kirtland Date: Sun, 14 Oct 2007 16:31:21 +0000 (+0000) Subject: Added test for DBAPIError exception wrapping. X-Git-Tag: rel_0_4_0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be6f2a9c5b6b3c51136917820350828794d7d126;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Added test for DBAPIError exception wrapping. --- diff --git a/test/engine/execute.py b/test/engine/execute.py index 3d3b43f9b6..28faf1102e 100644 --- a/test/engine/execute.py +++ b/test/engine/execute.py @@ -1,5 +1,6 @@ import testbase from sqlalchemy import * +from sqlalchemy import exceptions from testlib import * class ExecuteTest(PersistTest): @@ -61,6 +62,14 @@ class ExecuteTest(PersistTest): res = conn.execute("select * from users") assert res.fetchall() == [(1, "jack"), (2, "ed"), (3, "horse"), (4, 'sally')] conn.execute("delete from users") - + + def test_exception_wrapping(self): + for conn in (testbase.db, testbase.db.connect()): + try: + conn.execute("osdjafioajwoejoasfjdoifjowejfoawejqoijwef") + assert False + except exceptions.DBAPIError: + assert True + if __name__ == "__main__": testbase.main()