summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-06-19 19:24:10 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-06-19 19:24:10 -0400
commit0e84dcc48563db66cbbc8952f4f7709003a1ae15 (patch)
tree6404e76dc03d35fb737203082082703a5dde0edb /lib/sqlalchemy
parent61e83ec41bb0126e1c96a7a648e30a7f515c3ec9 (diff)
downloadsqlalchemy-0e84dcc48563db66cbbc8952f4f7709003a1ae15.tar.gz
- 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
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/testing/engines.py11
1 files changed, 8 insertions, 3 deletions
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