summaryrefslogtreecommitdiff
path: root/test/lib/engines.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-10-29 17:38:56 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-10-29 17:38:56 -0400
commite6a5ea8fa7d10078c8d3f1bf6cabc4399cac3e70 (patch)
tree316f3c5287a1389d214437dadb9c2dca0560410f /test/lib/engines.py
parent5d6376fbd5ca4103a26118a6fffd1e95be0d5161 (diff)
downloadsqlalchemy-e6a5ea8fa7d10078c8d3f1bf6cabc4399cac3e70.tar.gz
- [bug] Postgresql dialect memoizes that an ENUM of a
particular name was processed during a create/drop sequence. This allows a create/drop sequence to work without any calls to "checkfirst", and also means with "checkfirst" turned on it only needs to check for the ENUM once. [ticket:2311]
Diffstat (limited to 'test/lib/engines.py')
-rw-r--r--test/lib/engines.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/engines.py b/test/lib/engines.py
index 649c3e31a..c8a44dc44 100644
--- a/test/lib/engines.py
+++ b/test/lib/engines.py
@@ -247,12 +247,18 @@ def mock_engine(dialect_name=None):
def assert_sql(stmts):
recv = [re.sub(r'[\n\t]', '', str(s)) for s in buffer]
assert recv == stmts, recv
-
+ def print_sql():
+ d = engine.dialect
+ return "\n".join(
+ str(s.compile(dialect=d))
+ for s in engine.mock
+ )
engine = create_engine(dialect_name + '://',
strategy='mock', executor=executor)
assert not hasattr(engine, 'mock')
engine.mock = buffer
engine.assert_sql = assert_sql
+ engine.print_sql = print_sql
return engine
class DBAPIProxyCursor(object):