Skip to content

Commit

Permalink
Fix 'AsyncMockMixin._execute_mock_call' was never awaited runtime war…
Browse files Browse the repository at this point in the history
…ning
  • Loading branch information
Shutgun committed Oct 21, 2021
1 parent 971a417 commit 2ffd862
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def test_async_disconnect(self, mock_device):
assert not mock_device._connected

def test_disconnect(self, mock_device):
with patch("devolo_plc_api.device.Device.async_disconnect") as ad:
with patch("devolo_plc_api.device.Device.async_disconnect", new=Mock()) as ad:
mock_device.disconnect()
assert ad.call_count == 1

Expand All @@ -74,7 +74,7 @@ async def test__get_device_info(self, mock_device):
@pytest.mark.asyncio
@pytest.mark.usefixtures("mock_device_api")
async def test__get_device_info_timeout(self, mock_device):
with patch("devolo_plc_api.device.Device._get_zeroconf_info"), \
with patch("devolo_plc_api.device.Device._get_zeroconf_info", new=Mock()), \
patch("asyncio.wait_for", new=AsyncMock(side_effect=asyncio.TimeoutError())):
await mock_device._get_device_info()
assert mock_device.device is None
Expand All @@ -92,7 +92,7 @@ async def test__get_plcnet_info(self, mock_device):
@pytest.mark.asyncio
@pytest.mark.usefixtures("mock_plcnet_api")
async def test__get_plcnet_info_timeout(self, mock_device):
with patch("devolo_plc_api.device.Device._get_zeroconf_info"), \
with patch("devolo_plc_api.device.Device._get_zeroconf_info", new=Mock()), \
patch("asyncio.wait_for", new=AsyncMock(side_effect=asyncio.TimeoutError())):
await mock_device._get_plcnet_info()
assert mock_device.plcnet is None
Expand Down

0 comments on commit 2ffd862

Please sign in to comment.