From 55a5dfcb5bf18ed55875b0680d6540ed08d2c031 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Wed, 13 Mar 2024 18:07:38 +0100 Subject: [PATCH] Fix migrations for tests --- server/test/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/test/conftest.py b/server/test/conftest.py index 6a6bc6a6b..e05de9680 100644 --- a/server/test/conftest.py +++ b/server/test/conftest.py @@ -37,5 +37,9 @@ def use_random_db(request, worker_id): with engine.connect() as conn: conn.execute(sqlalchemy.text(f"CREATE DATABASE IF NOT EXISTS sbs_{worker_id}")) + # not sure why, but this is not picked up from AbstractTest.setUpClass + # and we need it in some of the migrations + os.environ["CONFIG"] = os.environ.get("CONFIG", "config/test_config.yml") + os.environ['SBS_DB_URI_OVERRIDE'] = database_uri db_migrations(database_uri)