mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 23:41:48 -05:00
Fix Portainer tests hanging on real event listener (#180464)
This commit is contained in:
@@ -139,9 +139,13 @@ def mock_portainer_client(mock_portainer_watcher: MagicMock) -> Generator[AsyncM
|
||||
yield client
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_portainer_event_listeners() -> Generator[dict[int, MagicMock]]:
|
||||
"""Mock PortainerEventListener; one MagicMock instance per endpoint_id."""
|
||||
"""Mock PortainerEventListener; one MagicMock instance per endpoint_id.
|
||||
|
||||
Autouse because the real listener reconnects in a tight loop when its
|
||||
event stream ends immediately, as the mocked client's does.
|
||||
"""
|
||||
instances: dict[int, MagicMock] = {}
|
||||
|
||||
def _factory(
|
||||
|
||||
Reference in New Issue
Block a user