From 0e84dcc48563db66cbbc8952f4f7709003a1ae15 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 19 Jun 2015 19:24:10 -0400 Subject: - repair that we use db_opts when the url here is different, as we are using db_opts for the first time with legacy_schema_args --- lib/sqlalchemy/testing/engines.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/testing/engines.py') diff --git a/lib/sqlalchemy/testing/engines.py b/lib/sqlalchemy/testing/engines.py index 8bd1becbf..1eaf62960 100644 --- a/lib/sqlalchemy/testing/engines.py +++ b/lib/sqlalchemy/testing/engines.py @@ -211,6 +211,7 @@ def testing_engine(url=None, options=None): """Produce an engine configured by --options with optional overrides.""" from sqlalchemy import create_engine + from sqlalchemy.engine.url import make_url if not options: use_reaper = True @@ -218,12 +219,16 @@ def testing_engine(url=None, options=None): use_reaper = options.pop('use_reaper', True) url = url or config.db.url + + url = make_url(url) if options is None: - options = config.db_opts + if config.db is None or url.drivername == config.db.url.drivername: + options = config.db_opts + else: + options = {} engine = create_engine(url, **options) - engine._has_events = True # enable event blocks, helps with - # profiling + engine._has_events = True # enable event blocks, helps with profiling if isinstance(engine.pool, pool.QueuePool): engine.pool._timeout = 0 -- cgit v1.2.1