summaryrefslogtreecommitdiff
path: root/tests/__init__.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-11-29 18:24:20 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-11-29 18:24:20 -0500
commitb91de33b0786905e053fe3fadbb19b86c9b4b333 (patch)
treed119bd1ae9e8259e190c3a30164b01a267758c80 /tests/__init__.py
parent2370cdf0f8decab38419aa28175e6be5cf35ac25 (diff)
downloadalembic-b91de33b0786905e053fe3fadbb19b86c9b4b333.tar.gz
- add mssql_batch_separator for offline mode
- implement SQL server alter column rules regarding NULL/NOT NULL
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index 0c35747..9013d8e 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -75,21 +75,22 @@ def assert_compiled(element, assert_string, dialect=None):
assert_string.replace("\n", "").replace("\t", "")
)
-def capture_context_buffer(transactional_ddl=None):
+def capture_context_buffer(**kw):
buf = StringIO.StringIO()
- if transactional_ddl is not None:
- context._context_opts['transactional_ddl'] = \
- transactional_ddl
-
class capture(object):
def __enter__(self):
- context._context_opts['output_buffer'] = buf
+ context.configure(
+ dialect_name="sqlite",
+ output_buffer = buf,
+ **kw
+ )
return buf
- def __exit__(self, *arg, **kw):
+ def __exit__(self, *arg, **kwarg):
print buf.getvalue()
- context._context_opts.pop('output_buffer', None)
+ for k in kw:
+ context._context_opts.pop(k, None)
return capture()