users, metadata, users_autoinc = None, None, None
+class SomeException(Exception):
+ pass
+
+
class ExecuteTest(fixtures.TestBase):
__backend__ = True
impl = Integer
def process_bind_param(self, value, dialect):
- raise Exception("nope")
+ raise SomeException("nope")
def _go(conn):
assert_raises_message(
tsa.exc.StatementError,
- r"\(exceptions.Exception\) nope \[SQL\: u?'SELECT 1 ",
+ r"\(test.engine.test_execute.SomeException\) "
+ "nope \[SQL\: u?'SELECT 1 ",
conn.execute,
select([1]).
where(
if is_transaction:
conn = conn.connection
conn.execute(self.table.insert().values(a=x, b=value))
- raise Exception("breakage")
+ raise SomeException("breakage")
return go
def _assert_no_data(self):
listener = Mock(return_value=None)
event.listen(engine, 'dbapi_error', listener)
- nope = Exception("nope")
+ nope = SomeException("nope")
class MyType(TypeDecorator):
impl = Integer
with engine.connect() as conn:
assert_raises_message(
tsa.exc.StatementError,
- r"\(exceptions.Exception\) nope \[SQL\: u?'SELECT 1 ",
+ r"\(test.engine.test_execute.SomeException\) "
+ "nope \[SQL\: u?'SELECT 1 ",
conn.execute,
select([1]).where(
column('foo') == literal('bar', MyType()))
listener = Mock(return_value=None)
event.listen(engine, 'handle_error', listener)
- nope = Exception("nope")
+ nope = SomeException("nope")
class MyType(TypeDecorator):
impl = Integer
with engine.connect() as conn:
assert_raises_message(
tsa.exc.StatementError,
- r"\(exceptions.Exception\) nope \[SQL\: u?'SELECT 1 ",
+ r"\(test.engine.test_execute.SomeException\) "
+ "nope \[SQL\: u?'SELECT 1 ",
conn.execute,
select([1]).where(
column('foo') == literal('bar', MyType()))