summaryrefslogtreecommitdiff
path: root/tests/test_op.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-05-16 08:55:51 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2023-05-16 13:50:09 -0400
commit513ab5d8029eaeb8cccee8eb931774d13a08d726 (patch)
tree823093e2f9acc729ae5f86ff7924ba2defa3d91b /tests/test_op.py
parentf983e1d1442070bfc35ce1c19379221c1baf54cf (diff)
downloadalembic-513ab5d8029eaeb8cccee8eb931774d13a08d726.tar.gz
restore drop_index.table_name, drop_constraint.type_ as positional
These two API changes were identified as having legacy use patterns and should be revisited using a deprecation warning for removal in either 1.12 or 1.13. Add documentation re: Alembic not using semver, fix incorrect calling signature example in batch documentation. Change-Id: I33dc5a8d058bcce77591bb037ae964e626a3387f Fixes: #1243 Fixes: #1245
Diffstat (limited to 'tests/test_op.py')
-rw-r--r--tests/test_op.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_op.py b/tests/test_op.py
index 35adeaf..6aca753 100644
--- a/tests/test_op.py
+++ b/tests/test_op.py
@@ -806,6 +806,17 @@ class OpTest(TestBase):
op.drop_constraint("foo_bar_bat", "t1")
context.assert_("ALTER TABLE t1 DROP CONSTRAINT foo_bar_bat")
+ def test_drop_constraint_type(self):
+ context = op_fixture()
+ op.drop_constraint("foo_bar_bat", "t1", type_="foreignkey")
+ context.assert_("ALTER TABLE t1 DROP CONSTRAINT foo_bar_bat")
+
+ def test_drop_constraint_legacy_type(self):
+ """#1245"""
+ context = op_fixture()
+ op.drop_constraint("foo_bar_bat", "t1", "foreignkey")
+ context.assert_("ALTER TABLE t1 DROP CONSTRAINT foo_bar_bat")
+
def test_drop_constraint_schema(self):
context = op_fixture()
op.drop_constraint("foo_bar_bat", "t1", schema="foo")
@@ -856,6 +867,17 @@ class OpTest(TestBase):
op.drop_index("ik_test")
context.assert_("DROP INDEX ik_test")
+ def test_drop_index_w_tablename(self):
+ context = op_fixture()
+ op.drop_index("ik_test", table_name="the_table")
+ context.assert_("DROP INDEX ik_test")
+
+ def test_drop_index_w_tablename_legacy(self):
+ """#1243"""
+ context = op_fixture()
+ op.drop_index("ik_test", "the_table")
+ context.assert_("DROP INDEX ik_test")
+
def test_drop_index_schema(self):
context = op_fixture()
op.drop_index("ik_test", schema="foo")