diff options
-rw-r--r-- | paste/deploy/loadwsgi.py | 2 | ||||
-rw-r--r-- | tests/sample_configs/test_filter.ini | 4 | ||||
-rw-r--r-- | tests/test_filter.py | 10 |
3 files changed, 15 insertions, 1 deletions
diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py index 3b0cff9..9f3dd0e 100644 --- a/paste/deploy/loadwsgi.py +++ b/paste/deploy/loadwsgi.py @@ -557,7 +557,7 @@ class ConfigLoader(_Loader): raise LookupError( "The [%s] pipeline section in %s has extra " "(disallowed) settings: %s" - % (', '.join(local_conf.keys()))) + % (section, self.filename, ', '.join(local_conf.keys()))) context = LoaderContext(None, PIPELINE, None, global_conf, local_conf, self) context.app_context = self.get_context( diff --git a/tests/sample_configs/test_filter.ini b/tests/sample_configs/test_filter.ini index bfad8dc..733c0aa 100644 --- a/tests/sample_configs/test_filter.ini +++ b/tests/sample_configs/test_filter.ini @@ -20,3 +20,7 @@ next = normal [app:inv] use = egg:FakeApp#basic_app filter-with = egg:FakeApp#caps + +[pipeline:piped3] +pipeline = egg:FakeApp#caps normal +extra_config_option = bad diff --git a/tests/test_filter.py b/tests/test_filter.py index a76af7c..470a9dd 100644 --- a/tests/test_filter.py +++ b/tests/test_filter.py @@ -51,3 +51,13 @@ def test_filter_with_filter_with(): assert isinstance(app, fakeapp.apps.CapFilter) assert isinstance(app.app, fakeapp.apps.CapFilter) assert app.app.app is fakeapp.apps.basic_app + + +def test_bad_pipeline(): + try: + app = loadapp('config:sample_configs/test_filter.ini#piped3', + relative_to=here) + except LookupError as err: + assert 'has extra (disallowed) settings' in err.args[0] + else: + assert False, 'should have raised LookupError' |