feat: 更新 ConfigManager 初始化,支持配置自动升级并添加相应测试

This commit is contained in:
DrSmoothl
2026-04-27 13:17:51 +08:00
parent 8de950df2e
commit 1fe9dc8786
3 changed files with 45 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ async def test_handle_file_changes_throttles_reload():
called = 0
async def reload_stub() -> bool:
async def reload_stub(changed_scopes=None) -> bool:
nonlocal called
called += 1
return True
@@ -36,7 +36,7 @@ async def test_handle_file_changes_timeout_logged(caplog):
manager._hot_reload_min_interval_s = 0.0
manager._hot_reload_timeout_s = 0.01
async def reload_stub() -> bool:
async def reload_stub(changed_scopes=None) -> bool:
await asyncio.sleep(0.05)
return True
@@ -55,7 +55,7 @@ async def test_handle_file_changes_empty_skips_reload():
called = 0
async def reload_stub() -> bool:
async def reload_stub(changed_scopes=None) -> bool:
nonlocal called
called += 1
return True