summaryrefslogtreecommitdiff
path: root/test/engine/test_bind.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/engine/test_bind.py')
-rw-r--r--test/engine/test_bind.py40
1 files changed, 18 insertions, 22 deletions
diff --git a/test/engine/test_bind.py b/test/engine/test_bind.py
index c958f6f4c..547afc64c 100644
--- a/test/engine/test_bind.py
+++ b/test/engine/test_bind.py
@@ -33,24 +33,18 @@ class BindTest(testing.TestBase):
def test_create_drop_err_metadata(self):
metadata = MetaData()
- table = Table('test_table', metadata,
- Column('foo', Integer))
-
- for meth in [
- metadata.create_all,
- metadata.drop_all,
- ]:
+ table = Table('test_table', metadata, Column('foo', Integer))
+ for meth in [metadata.create_all, metadata.drop_all]:
try:
meth()
assert False
except exc.UnboundExecutionError, e:
- eq_(
- str(e),
- "The MetaData "
- "is not bound to an Engine or Connection. "
- "Execution can not proceed without a database to execute "
- "against. Either execute with an explicit connection or "
- "assign the MetaData's .bind to enable implicit execution.")
+ eq_(str(e),
+ "The MetaData is not bound to an Engine or "
+ "Connection. Execution can not proceed without a "
+ "database to execute against. Either execute with "
+ "an explicit connection or assign the MetaData's "
+ ".bind to enable implicit execution.")
def test_create_drop_err_table(self):
metadata = MetaData()
@@ -153,7 +147,8 @@ class BindTest(testing.TestBase):
table.insert().execute(foo=7)
trans.rollback()
metadata.bind = None
- assert conn.execute("select count(1) from test_table").scalar() == 0
+ assert conn.execute('select count(1) from test_table'
+ ).scalar() == 0
finally:
metadata.drop_all(bind=conn)
@@ -167,7 +162,7 @@ class BindTest(testing.TestBase):
for elem in [
table.select,
lambda **kwargs: sa.func.current_timestamp(**kwargs).select(),
-# func.current_timestamp().select,
+ # func.current_timestamp().select,
lambda **kwargs:text("select * from test_table", **kwargs)
]:
for bind in (
@@ -188,12 +183,13 @@ class BindTest(testing.TestBase):
e.execute()
assert False
except exc.UnboundExecutionError, e:
- assert str(e).endswith(
- 'is not bound and does not support direct '
- 'execution. Supply this statement to a Connection or '
- 'Engine for execution. Or, assign a bind to the '
- 'statement or the Metadata of its underlying tables to '
- 'enable implicit execution via this method.')
+ assert str(e).endswith('is not bound and does not '
+ 'support direct execution. Supply this '
+ 'statement to a Connection or Engine for '
+ 'execution. Or, assign a bind to the '
+ 'statement or the Metadata of its '
+ 'underlying tables to enable implicit '
+ 'execution via this method.')
finally:
if isinstance(bind, engine.Connection):
bind.close()