]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- db_opts doesn't need to be a global since we no longer have any global
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 17 Jul 2015 15:09:29 +0000 (11:09 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 17 Jul 2015 15:09:29 +0000 (11:09 -0400)
option for it.  keep it local to production of config so values don't
leak in a multi --db situation.

lib/sqlalchemy/testing/plugin/plugin_base.py
lib/sqlalchemy/testing/provision.py

index ef304afa6d73f4ea10efb05e4541723bb77abfeb..6cdec05ad73a41abec01907d51773a92a208ab4c 100644 (file)
@@ -40,7 +40,6 @@ file_config = None
 
 
 logging = None
-db_opts = {}
 include_tags = set()
 exclude_tags = set()
 options = None
@@ -115,7 +114,6 @@ def memoize_important_follower_config(dict_):
 
     """
     dict_['memoized_config'] = {
-        'db_opts': db_opts,
         'include_tags': include_tags,
         'exclude_tags': exclude_tags
     }
@@ -127,8 +125,7 @@ def restore_important_follower_config(dict_):
     This invokes in the follower process.
 
     """
-    global db_opts, include_tags, exclude_tags
-    db_opts.update(dict_['memoized_config']['db_opts'])
+    global include_tags, exclude_tags
     include_tags.update(dict_['memoized_config']['include_tags'])
     exclude_tags.update(dict_['memoized_config']['exclude_tags'])
 
@@ -268,7 +265,7 @@ def _engine_uri(options, file_config):
 
     for db_url in db_urls:
         cfg = provision.setup_config(
-            db_url, db_opts, options, file_config, provision.FOLLOWER_IDENT)
+            db_url, options, file_config, provision.FOLLOWER_IDENT)
 
         if not config._current:
             cfg.set_as_current(cfg, testing)
index 8469a0658964411154a2f8da3ef35ef6fdce016b..77527571b39f6b665351f0e4dd0e3406a50bc271 100644 (file)
@@ -46,9 +46,10 @@ def configure_follower(follower_ident):
         _configure_follower(cfg, follower_ident)
 
 
-def setup_config(db_url, db_opts, options, file_config, follower_ident):
+def setup_config(db_url, options, file_config, follower_ident):
     if follower_ident:
         db_url = _follower_url_from_main(db_url, follower_ident)
+    db_opts = {}
     _update_db_opts(db_url, db_opts)
     eng = engines.testing_engine(db_url, db_opts)
     eng.connect().close()