diff options
-rw-r--r-- | paste/deploy/loadwsgi.py | 9 | ||||
-rw-r--r-- | tests/test_config.py | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py index 8b2849d..fc766b0 100644 --- a/paste/deploy/loadwsgi.py +++ b/paste/deploy/loadwsgi.py @@ -406,12 +406,11 @@ class ConfigLoader(_Loader): global_conf=global_conf) section = self.find_config_section( object_type, name=name) - if global_conf is None: - global_conf = {} - else: - global_conf = global_conf.copy() defaults = self.parser.defaults() - global_conf.update(defaults) + _global_conf = defaults.copy() + if global_conf is not None: + _global_conf.update(global_conf) + global_conf = _global_conf local_conf = {} global_additions = {} get_from_globals = {} diff --git a/tests/test_config.py b/tests/test_config.py index de40a2a..f64dd21 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -98,7 +98,8 @@ def test_foreign_config(): 'bob': 'your uncle'}) eq_(app.global_conf, { 'def1': 'a', - 'def2': 'from include', + # Note overwrite of DEFAULT value from foreign config + 'def2': 'b', 'def3': 'c', 'basepath': config_path, 'glob': 'override', @@ -150,8 +151,8 @@ def test_global_conf(): global_conf={'def2': 'TEST DEF 2', 'inherit': 'bazbar'}) eq_(conf, { 'def1': 'a', - # Note that this gets overwritten: - 'def2': 'b', + # Note overwrite of DEFAULT value + 'def2': 'TEST DEF 2', 'basepath': os.path.join(here, 'sample_configs'), 'here': config_path, 'inherit': 'bazbar', |