summaryrefslogtreecommitdiff
path: root/test/engine/test_bind.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-10 23:37:15 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-10 23:37:15 -0500
commit134a4cb3a6f4ee0e2c2865d97cf20f829b29f162 (patch)
tree820616703d51e6633c1067a4187af9c7390ddc53 /test/engine/test_bind.py
parent848257f7d2f325f67e2dab553d0ee9e5d89f03d6 (diff)
downloadsqlalchemy-134a4cb3a6f4ee0e2c2865d97cf20f829b29f162.tar.gz
fix some tests
Diffstat (limited to 'test/engine/test_bind.py')
-rw-r--r--test/engine/test_bind.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/test/engine/test_bind.py b/test/engine/test_bind.py
index 855c3611e..0ef70c244 100644
--- a/test/engine/test_bind.py
+++ b/test/engine/test_bind.py
@@ -1,7 +1,7 @@
"""tests the "bind" attribute/argument across schema and SQL,
including the deprecated versions of these arguments"""
-from test.lib.testing import eq_
+from test.lib.testing import eq_, assert_raises
from sqlalchemy import engine, exc
from sqlalchemy import MetaData, ThreadLocalMetaData
from sqlalchemy import Integer, text
@@ -177,19 +177,12 @@ class BindTest(testing.TestBase):
if isinstance(bind, engine.Connection):
bind.close()
- try:
- e = elem()
- assert e.bind is None
- 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.')
+ e = elem()
+ assert e.bind is None
+ assert_raises(
+ exc.UnboundExecutionError,
+ e.execute
+ )
finally:
if isinstance(bind, engine.Connection):
bind.close()