diff options
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index fb54e8a..f0bd167 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,5 +1,7 @@ from alembic import config -from tests import eq_ +from alembic.migration import MigrationContext +from alembic.operations import Operations +from tests import eq_, capture_db def test_config_no_file_main_option(): cfg = config.Config() @@ -15,4 +17,14 @@ def test_config_no_file_section_option(): eq_(cfg.get_section_option("foo", "url"), "postgresql://foo/bar") cfg.set_section_option("foo", "echo", "True") - eq_(cfg.get_section_option("foo", "echo"), "True")
\ No newline at end of file + eq_(cfg.get_section_option("foo", "echo"), "True") + + +def test_standalone_op(): + eng, buf = capture_db() + + env = MigrationContext.configure(eng) + op = Operations(env) + + op.alter_column("t", "c", nullable=True) + eq_(buf, ['ALTER TABLE t ALTER COLUMN c DROP NOT NULL']) |