summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2023-05-12 16:00:07 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2023-05-12 16:00:07 +0000
commit497c6c86b9547eed2ac297b1618300430578b86f (patch)
treec7e3480718beb7ce2ea8ff9ef2a34d491b9f1d36 /tests
parent230a2932f646800b006c00b434be95c164598525 (diff)
parentdf75e85489b9ae69fffff2c5ad2594b30bed2fd4 (diff)
downloadalembic-497c6c86b9547eed2ac297b1618300430578b86f.tar.gz
Merge "keyword only arguments in ops" into main
Diffstat (limited to 'tests')
-rw-r--r--tests/test_batch.py2
-rw-r--r--tests/test_mssql.py2
-rw-r--r--tests/test_mysql.py18
-rw-r--r--tests/test_oracle.py2
-rw-r--r--tests/test_postgresql.py12
5 files changed, 22 insertions, 14 deletions
diff --git a/tests/test_batch.py b/tests/test_batch.py
index 52f9baf..66d59fd 100644
--- a/tests/test_batch.py
+++ b/tests/test_batch.py
@@ -1778,7 +1778,7 @@ class BatchRoundTripTest(TestBase):
with self.op.batch_alter_table(
"ck_table", recreate=recreate
) as batch_op:
- batch_op.drop_constraint("ck", "check")
+ batch_op.drop_constraint("ck", type_="check")
ck_consts = inspect(self.conn).get_check_constraints("ck_table")
eq_(ck_consts, [])
diff --git a/tests/test_mssql.py b/tests/test_mssql.py
index 640e168..b785e2f 100644
--- a/tests/test_mssql.py
+++ b/tests/test_mssql.py
@@ -158,7 +158,7 @@ class OpTest(TestBase):
def test_drop_index(self):
context = op_fixture("mssql")
- op.drop_index("my_idx", "my_table")
+ op.drop_index("my_idx", table_name="my_table")
context.assert_contains("DROP INDEX my_idx ON my_table")
def test_drop_column_w_default(self):
diff --git a/tests/test_mysql.py b/tests/test_mysql.py
index 92c1819..fd3b185 100644
--- a/tests/test_mysql.py
+++ b/tests/test_mysql.py
@@ -396,12 +396,12 @@ class MySQLOpTest(TestBase):
def test_drop_fk(self):
context = op_fixture("mysql")
- op.drop_constraint("f1", "t1", "foreignkey")
+ op.drop_constraint("f1", "t1", type_="foreignkey")
context.assert_("ALTER TABLE t1 DROP FOREIGN KEY f1")
def test_drop_fk_quoted(self):
context = op_fixture("mysql")
- op.drop_constraint("MyFk", "MyTable", "foreignkey")
+ op.drop_constraint("MyFk", "MyTable", type_="foreignkey")
context.assert_("ALTER TABLE `MyTable` DROP FOREIGN KEY `MyFk`")
def test_drop_constraint_primary(self):
@@ -411,32 +411,32 @@ class MySQLOpTest(TestBase):
def test_drop_unique(self):
context = op_fixture("mysql")
- op.drop_constraint("f1", "t1", "unique")
+ op.drop_constraint("f1", "t1", type_="unique")
context.assert_("ALTER TABLE t1 DROP INDEX f1")
def test_drop_unique_quoted(self):
context = op_fixture("mysql")
- op.drop_constraint("MyUnique", "MyTable", "unique")
+ op.drop_constraint("MyUnique", "MyTable", type_="unique")
context.assert_("ALTER TABLE `MyTable` DROP INDEX `MyUnique`")
def test_drop_check_mariadb(self):
context = op_fixture("mariadb")
- op.drop_constraint("f1", "t1", "check")
+ op.drop_constraint("f1", "t1", type_="check")
context.assert_("ALTER TABLE t1 DROP CONSTRAINT f1")
def test_drop_check_quoted_mariadb(self):
context = op_fixture("mariadb")
- op.drop_constraint("MyCheck", "MyTable", "check")
+ op.drop_constraint("MyCheck", "MyTable", type_="check")
context.assert_("ALTER TABLE `MyTable` DROP CONSTRAINT `MyCheck`")
def test_drop_check_mysql(self):
context = op_fixture("mysql")
- op.drop_constraint("f1", "t1", "check")
+ op.drop_constraint("f1", "t1", type_="check")
context.assert_("ALTER TABLE t1 DROP CHECK f1")
def test_drop_check_quoted_mysql(self):
context = op_fixture("mysql")
- op.drop_constraint("MyCheck", "MyTable", "check")
+ op.drop_constraint("MyCheck", "MyTable", type_="check")
context.assert_("ALTER TABLE `MyTable` DROP CHECK `MyCheck`")
def test_drop_unknown(self):
@@ -448,7 +448,7 @@ class MySQLOpTest(TestBase):
op.drop_constraint,
"f1",
"t1",
- "typo",
+ type_="typo",
)
def test_drop_generic_constraint(self):
diff --git a/tests/test_oracle.py b/tests/test_oracle.py
index f84c0e1..63ac1c4 100644
--- a/tests/test_oracle.py
+++ b/tests/test_oracle.py
@@ -163,7 +163,7 @@ class OpTest(TestBase):
def test_drop_index(self):
context = op_fixture("oracle")
- op.drop_index("my_idx", "my_table")
+ op.drop_index("my_idx", table_name="my_table")
context.assert_contains("DROP INDEX my_idx")
def test_drop_column_w_default(self):
diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py
index 818dae7..82a3f3b 100644
--- a/tests/test_postgresql.py
+++ b/tests/test_postgresql.py
@@ -122,9 +122,17 @@ class PostgresqlOpTest(TestBase):
op.create_index("i", "t", ["c1", "c2"], unique=False)
context.assert_("CREATE INDEX i ON t (c1, c2)")
- def test_drop_index_postgresql_concurrently(self):
+ @config.combinations("include_table", "no_table", argnames="include_table")
+ def test_drop_index_postgresql_concurrently(self, include_table):
context = op_fixture("postgresql")
- op.drop_index("geocoded", "locations", postgresql_concurrently=True)
+ if include_table == "include_table":
+ op.drop_index(
+ "geocoded",
+ table_name="locations",
+ postgresql_concurrently=True,
+ )
+ else:
+ op.drop_index("geocoded", postgresql_concurrently=True)
context.assert_("DROP INDEX CONCURRENTLY geocoded")
def test_alter_column_type_using(self):