From ff2266bfac552ddf2fbed6cad91f2af35fbcbb7e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 4 Jun 2013 18:49:24 -0400 Subject: [PATCH] clean up the dialect selection thing here --- lib/sqlalchemy/testing/assertions.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 5924673025..96a8bc0237 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -184,15 +184,19 @@ class AssertsCompiledSQL(object): allow_dialect_select=False): if use_default_dialect: dialect = default.DefaultDialect() - elif dialect == None and not allow_dialect_select: - dialect = getattr(self, '__dialect__', None) + elif allow_dialect_select: + dialect = None + else: + if dialect is None: + dialect = getattr(self, '__dialect__', None) + + if dialect is None: + dialect = config.db.dialect + elif dialect == 'default': + dialect = default.DefaultDialect() + elif isinstance(dialect, util.string_types): + dialect = create_engine("%s://" % dialect).dialect - if dialect == 'default': - dialect = default.DefaultDialect() - elif dialect is None: - dialect = config.db.dialect - elif isinstance(dialect, util.string_types): - dialect = create_engine("%s://" % dialect).dialect kw = {} if params is not None: -- 2.47.3