diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-09 18:11:40 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-09 18:11:40 -0500 |
commit | 7e8f35109725ed3fd3caf96acf8b94a13c53fdfe (patch) | |
tree | 6ee96b736322eff04bb1ec5ff2b6e9de84e5545c /test/sql/test_constraints.py | |
parent | e80eac22a8669ada5ffaabbcfa8a991eee140697 (diff) | |
download | sqlalchemy-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_constraints.py')
-rw-r--r-- | test/sql/test_constraints.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sql/test_constraints.py b/test/sql/test_constraints.py index 4bacbd271..f4791c0bd 100644 --- a/test/sql/test_constraints.py +++ b/test/sql/test_constraints.py @@ -79,9 +79,9 @@ class ConstraintTest(TestBase, AssertsExecutionResults, AssertsCompiledSQL): metadata.create_all() foo.insert().execute(id=1,x=9,y=5) - assert_raises(exc.SQLError, foo.insert().execute, id=2,x=5,y=9) + assert_raises(exc.DBAPIError, foo.insert().execute, id=2,x=5,y=9) bar.insert().execute(id=1,x=10) - assert_raises(exc.SQLError, bar.insert().execute, id=2,x=5) + assert_raises(exc.DBAPIError, bar.insert().execute, id=2,x=5) def test_unique_constraint(self): foo = Table('foo', metadata, @@ -98,8 +98,8 @@ class ConstraintTest(TestBase, AssertsExecutionResults, AssertsCompiledSQL): foo.insert().execute(id=2, value='value2') bar.insert().execute(id=1, value='a', value2='a') bar.insert().execute(id=2, value='a', value2='b') - assert_raises(exc.SQLError, foo.insert().execute, id=3, value='value1') - assert_raises(exc.SQLError, bar.insert().execute, id=3, value='a', value2='b') + assert_raises(exc.DBAPIError, foo.insert().execute, id=3, value='value1') + assert_raises(exc.DBAPIError, bar.insert().execute, id=3, value='a', value2='b') def test_index_create(self): employees = Table('employees', metadata, |