diff --git a/src/openeo_aggregator/app.py b/src/openeo_aggregator/app.py index 7449c910..5e565e73 100644 --- a/src/openeo_aggregator/app.py +++ b/src/openeo_aggregator/app.py @@ -27,7 +27,7 @@ _log = logging.getLogger(__name__) -def create_app(config: Any = None, auto_logging_setup: bool = True) -> flask.Flask: +def create_app(config: Any = None, auto_logging_setup: bool = True, flask_error_handling: bool = True) -> flask.Flask: """ Flask application factory function. """ @@ -54,7 +54,7 @@ def create_app(config: Any = None, auto_logging_setup: bool = True) -> flask.Fla _log.info(f"Building Flask app with {backend_implementation=!r}") app = openeo_driver.views.build_app( backend_implementation=backend_implementation, - error_handling=config.flask_error_handling, + error_handling=flask_error_handling, ) app.config.from_mapping( diff --git a/src/openeo_aggregator/config.py b/src/openeo_aggregator/config.py index 8b317fca..f61a9218 100644 --- a/src/openeo_aggregator/config.py +++ b/src/openeo_aggregator/config.py @@ -44,7 +44,6 @@ class AggregatorConfig(dict): # Dictionary mapping backend id to backend url aggregator_backends = dict_item() - flask_error_handling = dict_item(default=True) streaming_chunk_size = dict_item(default=STREAM_CHUNK_SIZE_DEFAULT) # TODO: add validation/normalization to make sure we have a real list of OidcProvider objects? diff --git a/tests/conftest.py b/tests/conftest.py index a1804922..7a82cece 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -177,9 +177,13 @@ def multi_backend_connection(config) -> MultiBackendConnection: def get_flask_app(config: AggregatorConfig) -> flask.Flask: - app = create_app(config=config, auto_logging_setup=False) - app.config['TESTING'] = True - app.config['SERVER_NAME'] = 'oeoa.test' + app = create_app( + config=config, + auto_logging_setup=False, + # flask_error_handling=False, # Failing test debug tip: set to False for deeper stack trace insights + ) + app.config["TESTING"] = True + app.config["SERVER_NAME"] = "oeoa.test" return app diff --git a/tests/test_config.py b/tests/test_config.py index a7d9c319..46f9eb33 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -31,7 +31,6 @@ def test_config_defaults(): config = AggregatorConfig() with pytest.raises(KeyError): _ = config.aggregator_backends - assert config.flask_error_handling is True assert config.streaming_chunk_size == STREAM_CHUNK_SIZE_DEFAULT