Skip to content

Commit df6c674

Browse files
authored
chore: fix test warning (#519)
* chore: fix test warning * chore: adjust test case
1 parent 037761c commit df6c674

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections.abc import AsyncGenerator, Callable, Generator
77
from queue import Queue
88
from typing import Any
9-
from unittest.mock import AsyncMock, Mock, patch
9+
from unittest.mock import AsyncMock, MagicMock, Mock, patch
1010

1111
import pytest
1212
from aioresponses import aioresponses
@@ -360,12 +360,12 @@ def __init__(self):
360360
self.publish = AsyncMock(side_effect=self._publish)
361361
self.subscribe = AsyncMock(side_effect=self._subscribe)
362362
self.connect = AsyncMock(side_effect=self._connect)
363-
self.close = AsyncMock(side_effect=self._close)
363+
self.close = MagicMock(side_effect=self._close)
364364

365365
async def _connect(self) -> None:
366366
self._is_connected = True
367367

368-
async def _close(self) -> None:
368+
def _close(self) -> None:
369369
self._is_connected = False
370370

371371
@property

tests/devices/test_v1_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ async def test_v1_channel_mqtt_disconnected(
174174
mock_local_channel.connect.assert_called_once()
175175

176176
# Simulate an MQTT disconnection where the channel is not healthy
177-
await mock_mqtt_channel.close()
177+
mock_mqtt_channel.close()
178178

179179
# Verify properties
180180
assert not v1_channel.is_mqtt_connected

0 commit comments

Comments
 (0)