From d1005e130558b33fd455be6d994e8e863799a318 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 18 Aug 2020 22:53:09 -0400 Subject: Implement DDL visitor for PG ENUM with schema translate support Fixed issue where the :class:`_postgresql.ENUM` type would not consult the schema translate map when emitting a CREATE TYPE or DROP TYPE during the test to see if the type exists or not. Additionally, repaired an issue where if the same enum were encountered multiple times in a single DDL sequence, the "check" query would run repeatedly rather than relying upon a cached value. Fixes: #5520 Change-Id: I79f46e29ac0168e873ff178c242f8d78f6679aeb --- lib/sqlalchemy/testing/assertsql.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/testing/assertsql.py') diff --git a/lib/sqlalchemy/testing/assertsql.py b/lib/sqlalchemy/testing/assertsql.py index caf61a806..73b062b96 100644 --- a/lib/sqlalchemy/testing/assertsql.py +++ b/lib/sqlalchemy/testing/assertsql.py @@ -195,12 +195,12 @@ class CompiledSQL(SQLMatchRule): class RegexSQL(CompiledSQL): - def __init__(self, regex, params=None): + def __init__(self, regex, params=None, dialect="default"): SQLMatchRule.__init__(self) self.regex = re.compile(regex) self.orig_regex = regex self.params = params - self.dialect = "default" + self.dialect = dialect def _failure_message(self, expected_params): return ( -- cgit v1.2.1