Fix yalex_ble test RuntimeWarning (#97732)

This commit is contained in:
Marc Mueller 2023-08-04 00:55:18 +02:00 committed by GitHub
parent f7aec46b69
commit 52fc3c26d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
"""Test the Yale Access Bluetooth config flow.""" """Test the Yale Access Bluetooth config flow."""
import asyncio import asyncio
from unittest.mock import AsyncMock, Mock, patch from unittest.mock import AsyncMock, MagicMock, Mock, patch
from bleak import BleakError from bleak import BleakError
import pytest import pytest
@ -32,6 +32,7 @@ def _get_mock_push_lock():
"""Return a mock PushLock.""" """Return a mock PushLock."""
mock_push_lock = Mock() mock_push_lock = Mock()
mock_push_lock.start = AsyncMock() mock_push_lock.start = AsyncMock()
mock_push_lock.start.return_value = MagicMock()
mock_push_lock.wait_for_first_update = AsyncMock() mock_push_lock.wait_for_first_update = AsyncMock()
mock_push_lock.stop = AsyncMock() mock_push_lock.stop = AsyncMock()
mock_push_lock.lock_state = LockState( mock_push_lock.lock_state = LockState(