summaryrefslogtreecommitdiff
path: root/test/sql/test_query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-09 18:11:40 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-09 18:11:40 -0500
commit7e8f35109725ed3fd3caf96acf8b94a13c53fdfe (patch)
tree6ee96b736322eff04bb1ec5ff2b6e9de84e5545c /test/sql/test_query.py
parente80eac22a8669ada5ffaabbcfa8a991eee140697 (diff)
downloadsqlalchemy-7e8f35109725ed3fd3caf96acf8b94a13c53fdfe.tar.gz
- Non-DBAPI errors which occur in the scope of an `execute()`
call are now wrapped in sqlalchemy.exc.StatementError, and the text of the SQL statement and repr() of params is included. This makes it easier to identify statement executions which fail before the DBAPI becomes involved. [ticket:2015]
Diffstat (limited to 'test/sql/test_query.py')
-rw-r--r--test/sql/test_query.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index cbf6e6e58..359084cd8 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -48,8 +48,8 @@ class QueryTest(TestBase):
def test_insert_heterogeneous_params(self):
"""test that executemany parameters are asserted to match the parameter set of the first."""
- assert_raises_message(exc.InvalidRequestError,
- "A value is required for bind parameter 'user_name', in parameter group 2",
+ assert_raises_message(exc.StatementError,
+ "A value is required for bind parameter 'user_name', in parameter group 2 'INSERT INTO query_users",
users.insert().execute,
{'user_id':7, 'user_name':'jack'},
{'user_id':8, 'user_name':'ed'},
@@ -852,8 +852,8 @@ class QueryTest(TestBase):
def test_cant_execute_join(self):
try:
users.join(addresses).execute()
- except exc.ArgumentError, e:
- assert str(e).startswith('Not an executable clause: ')
+ except exc.StatementError, e:
+ assert str(e).startswith('Not an executable clause ')