Commits

jason kirtland committed fae132e

Added test for DBAPIError exception wrapping.

Comments (0)

Files changed (1)

test/engine/execute.py

 import testbase
 from sqlalchemy import *
+from sqlalchemy import exceptions
 from testlib import *
 
 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()