From: Mike Bayer Date: Tue, 4 Jun 2013 22:49:24 +0000 (-0400) Subject: clean up the dialect selection thing here X-Git-Tag: rel_0_9_0b1~294^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff2266bfac552ddf2fbed6cad91f2af35fbcbb7e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git clean up the dialect selection thing here --- 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: