From 465853ac599a9044e20b4562abc0ed2502c5ad3c Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Wed, 30 Sep 2026 20:19:09 -0400 Subject: [PATCH] =?UTF-8?q?fix(tests):=20A1=20=E2=80=94=20fin=20du=20rebin?= =?UTF-8?q?ding=20app.config.settings=20dans=20test=5Fv54=20(isolation=20r?= =?UTF-8?q?=C3=A9tablie,=201016/1016=20verts)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le rebind (`app.config.settings = Settings()`) laissait tous les modules déjà importés (sso_provisioning, trash, …) sur un objet périmé : le test test_v67_sso::test_env_config_fallback_when_table_empty échouait dès qu'il tournait après test_v54 dans le même worker (-n auto). Mutation sur place comme le préconise conftest.py. --- tests/test_v54.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_v54.py b/tests/test_v54.py index de80991..7084bb2 100644 --- a/tests/test_v54.py +++ b/tests/test_v54.py @@ -205,7 +205,14 @@ class TestV54TrashPurge: os.environ["PROJECT_SYNC_ENABLED"] = "false" import app.config - app.config.settings = app.config.Settings() + # In-place mutation, jamais de rebinding : les modules importés plus tôt + # (sso_provisioning, trash, …) gardent une référence à l'objet courant. + _s = app.config.settings + _s.database_url = f"sqlite:///{tmp.name}" + _s.app_secret_key = "test-secret" + _s.rate_limit_enabled = False + _s.backup_enabled = False + _s.project_sync_enabled = False init_db() with get_conn() as conn: