From d71ae4831cb21ffb6f3b2387dd76c2b491b52474 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Feb 2019 01:48:02 -0600 Subject: [PATCH] moved database connection call into the get_base_config function so it is not attempted at import time. this is necessary to allow the behave tests to create a test database --- shared/selene/api/base_config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/selene/api/base_config.py b/shared/selene/api/base_config.py index b9120e41..b65c6675 100644 --- a/shared/selene/api/base_config.py +++ b/shared/selene/api/base_config.py @@ -38,7 +38,7 @@ class APIConfigError(Exception): class BaseConfig(object): """Base configuration.""" ACCESS_SECRET = os.environ['JWT_ACCESS_SECRET'] - DB_CONNECTION_POOL = allocate_db_connection_pool(db_connection_config) + DB_CONNECTION_POOL = None DEBUG = False ENV = os.environ['SELENE_ENVIRONMENT'] REFRESH_SECRET = os.environ['JWT_REFRESH_SECRET'] @@ -79,4 +79,8 @@ def get_base_config(): error_msg = 'no configuration defined for the "{}" environment' raise APIConfigError(error_msg.format(environment_name)) + app_config.DB_CONNECTION_POOL = allocate_db_connection_pool( + db_connection_config + ) + return app_config