mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
fix(runtime): enforce main event loop ownership (#6424)
This commit is contained in:
@@ -4,6 +4,7 @@ from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from app.runtime.config import global_vars
|
||||
from app.startup import lifecycle
|
||||
|
||||
|
||||
@@ -23,6 +24,11 @@ async def test_runtime_ready_waits_for_scheduler_and_command_refresh(monkeypatch
|
||||
return []
|
||||
|
||||
monkeypatch.setattr(lifecycle.settings, "MOVIEPILOT_SAFE_MODE", False)
|
||||
monkeypatch.setattr(
|
||||
global_vars,
|
||||
"CURRENT_EVENT_LOOP",
|
||||
asyncio.get_running_loop(),
|
||||
)
|
||||
monkeypatch.setattr(lifecycle, "get_plugin_manager", lambda: manager)
|
||||
monkeypatch.setattr(lifecycle, "sync_plugins", sync_plugins)
|
||||
monkeypatch.setattr(lifecycle, "execute_task", execute_task)
|
||||
|
||||
Reference in New Issue
Block a user