Fix snapcast test warning (#116687)

This commit is contained in:
Marc Mueller 2024-05-03 13:29:05 +02:00 committed by GitHub
parent 15b24dfbc2
commit 28ab45d5d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
"""Test the snapcast config flow.""" """Test the snapcast config flow."""
from collections.abc import Generator from collections.abc import Generator
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, MagicMock, patch
import pytest import pytest
@ -20,5 +20,6 @@ def mock_create_server() -> Generator[AsyncMock, None, None]:
"""Create mock snapcast connection.""" """Create mock snapcast connection."""
mock_connection = AsyncMock() mock_connection = AsyncMock()
mock_connection.start = AsyncMock(return_value=None) mock_connection.start = AsyncMock(return_value=None)
mock_connection.stop = MagicMock()
with patch("snapcast.control.create_server", return_value=mock_connection): with patch("snapcast.control.create_server", return_value=mock_connection):
yield mock_connection yield mock_connection