If you have an instance/config.py to override local development it would also override testing.

This commit is contained in:
Dan 2023-02-08 13:37:56 -05:00
parent 1921d0d174
commit cbbaab482a
1 changed files with 2 additions and 0 deletions

View File

@ -91,6 +91,8 @@ def setup_config(app: Flask) -> None:
# This allows config/testing.py or instance/config.py to override the default config
if "ENV_IDENTIFIER" in app.config and app.config["ENV_IDENTIFIER"] == "testing":
app.config.from_pyfile("config/testing.py", silent=True)
elif "ENV_IDENTIFIER" in app.config and app.config["ENV_IDENTIFIER"] == "unit_testing":
app.config.from_pyfile("config/unit_testing.py", silent=True)
else:
app.config.from_pyfile(f"{app.instance_path}/config.py", silent=True)