summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-01-28 09:37:50 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2023-01-28 09:39:24 -0500
commit70d1de6cff816d4627dd6b72223d9796e28aca1e (patch)
treea08ab476f0a6208b4d1045f504d20d28b046a67d /test/sql
parentecdaf44711f1feb002ad98b6e917cc575a1bd801 (diff)
downloadsqlalchemy-70d1de6cff816d4627dd6b72223d9796e28aca1e.tar.gz
Correct #7664 to include DropSchema
Corrected the fix for :ticket:`7664`, released in version 2.0.0, to also include :class:`.DropSchema` which was inadvertently missed in this fix, allowing stringification without a dialect. The fixes for both constructs is backported to the 1.4 series as of 1.4.47. Fixes: #7664 Change-Id: I509b7500ee496ac1e444ea2096c2a02520167e6d
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_metadata.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/sql/test_metadata.py b/test/sql/test_metadata.py
index 0cd73922e..684ad3a07 100644
--- a/test/sql/test_metadata.py
+++ b/test/sql/test_metadata.py
@@ -2623,6 +2623,7 @@ class SchemaTest(fixtures.TestBase, AssertsCompiledSQL):
@testing.combinations(
(schema.CreateSchema("sa_schema"), "CREATE SCHEMA sa_schema"),
+ (schema.DropSchema("sa_schema"), "DROP SCHEMA sa_schema"),
# note we don't yet support lower-case table() or
# lower-case column() for this
# (
@@ -2634,6 +2635,10 @@ class SchemaTest(fixtures.TestBase, AssertsCompiledSQL):
"CREATE TABLE t (q INTEGER)",
),
(
+ schema.DropTable(Table("t", MetaData(), Column("q", Integer))),
+ "DROP TABLE t",
+ ),
+ (
schema.CreateIndex(
Index(
"foo",
@@ -2643,6 +2648,18 @@ class SchemaTest(fixtures.TestBase, AssertsCompiledSQL):
),
"CREATE INDEX foo ON t (x)",
),
+ (
+ schema.DropIndex(
+ Index(
+ "foo",
+ "x",
+ _table=Table("t", MetaData(), Column("x", Integer)),
+ )
+ ),
+ "DROP INDEX foo",
+ ),
+ (schema.CreateSequence(Sequence("my_seq")), "CREATE SEQUENCE my_seq"),
+ (schema.DropSequence(Sequence("my_seq")), "DROP SEQUENCE my_seq"),
)
def test_stringify_schema_elements(self, element, expected):
eq_ignore_whitespace(str(element), expected)