Skip to content

Commit ec780c9

Browse files
authored
chore: Fix warning in tests/devices/test_device_manager.py (#412)
* chore: Fix warning in tests/devices/test_device_manager.py * chore: Fix lint in test
1 parent f1dd1fe commit ec780c9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/devices/test_device_manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Tests for the DeviceManager class."""
22

33
from collections.abc import Generator
4-
from unittest.mock import patch
4+
from unittest.mock import Mock, patch
55

66
import pytest
77

@@ -16,10 +16,12 @@
1616

1717

1818
@pytest.fixture(autouse=True)
19-
def setup_mqtt_session() -> Generator[None, None, None]:
19+
def setup_mqtt_session() -> Generator[Mock, None, None]:
2020
"""Fixture to set up the MQTT session for the tests."""
21-
with patch("roborock.devices.device_manager.create_mqtt_session"):
22-
yield
21+
with patch("roborock.devices.device_manager.create_mqtt_session") as mock_create_session:
22+
mock_unsub = Mock()
23+
mock_create_session.return_value.subscribe.return_value = mock_unsub
24+
yield mock_create_session
2325

2426

2527
async def home_home_data_no_devices() -> HomeData:

0 commit comments

Comments
 (0)