diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-04 18:49:24 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-04 18:49:24 -0400 |
commit | ff2266bfac552ddf2fbed6cad91f2af35fbcbb7e (patch) | |
tree | 98d7af9b774eecd727d80038108035443f005897 /lib/sqlalchemy/testing/assertions.py | |
parent | c7b52003fb369637d5f72d2a45ff256638b6362d (diff) | |
download | sqlalchemy-ff2266bfac552ddf2fbed6cad91f2af35fbcbb7e.tar.gz |
clean up the dialect selection thing here
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
-rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 592467302..96a8bc023 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: |