From 5e3cc83d1768485c36b2dec4d852bfb5bddd328c Mon Sep 17 00:00:00 2001 From: taohe Date: Thu, 11 Jun 2026 18:15:53 +0800 Subject: [PATCH] Isolate channel runtime config tests --- backend/tests/test_channel_connections_router.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/tests/test_channel_connections_router.py b/backend/tests/test_channel_connections_router.py index de1bb617b..bcc977b00 100644 --- a/backend/tests/test_channel_connections_router.py +++ b/backend/tests/test_channel_connections_router.py @@ -2,6 +2,7 @@ from __future__ import annotations +from tempfile import TemporaryDirectory from types import SimpleNamespace from uuid import UUID @@ -54,8 +55,11 @@ def _make_app( app.state.channel_connection_repo = repo if set_channels_config_state: app.state.channels_config = channels_config or {} - if runtime_config_store is not None: - app.state.channel_runtime_config_store = runtime_config_store + if runtime_config_store is None: + runtime_config_dir = TemporaryDirectory() + app.state.channel_runtime_config_tmpdir = runtime_config_dir + runtime_config_store = ChannelRuntimeConfigStore(f"{runtime_config_dir.name}/runtime-config.json") + app.state.channel_runtime_config_store = runtime_config_store app.include_router(channel_connections.router) return app