summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-03-22 10:13:15 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-03-22 10:13:15 -0400
commit28edc2604a96d5ecd8318232c95a034433aa07d1 (patch)
tree14f80cda668a95325ccda65f7b0c88612e1aea96 /lib/sqlalchemy/testing
parent711d29f8e4dc096f5083c075a1f64eb38e2d2e4a (diff)
downloadsqlalchemy-28edc2604a96d5ecd8318232c95a034433aa07d1.tar.gz
Use config.db global opts as defaults for all testing_engine()
Some options need to be passed to engines in all cases, such as currently the oracle 12516 workaround. make sure calls to testing_engine also set up the dictionary with defaults even if options is passed. not clear if this affects other backends yet. Change-Id: I5a1f7634e4ce5af6fe55dc21a24db6afacd19bb7
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r--lib/sqlalchemy/testing/engines.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/engines.py b/lib/sqlalchemy/testing/engines.py
index 4510ba6e5..2c077cfe0 100644
--- a/lib/sqlalchemy/testing/engines.py
+++ b/lib/sqlalchemy/testing/engines.py
@@ -242,6 +242,9 @@ def testing_engine(url=None, options=None):
options = config.db_opts
else:
options = {}
+ elif config.db is not None and url.drivername == config.db.url.drivername:
+ default_opt = config.db_opts.copy()
+ default_opt.update(options)
engine = create_engine(url, **options)
engine._has_events = True # enable event blocks, helps with profiling