Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/test_device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test communicating with a devolo device."""

from asyncio import AbstractEventLoop
from asyncio import get_event_loop
from unittest.mock import AsyncMock, Mock, patch

import pytest
Expand Down Expand Up @@ -104,10 +104,10 @@ async def test_async_disconnect(self, mock_device: Device):
assert mock_device._session.aclose.call_count == 0 # type: ignore[attr-defined]
assert not mock_device._connected

def test_disconnect(self, mock_device: Device, event_loop: AbstractEventLoop):
def test_disconnect(self, mock_device: Device):
"""Test that the sync disconnect method just calls the async disconnect method."""
with patch("devolo_plc_api.device.Device.async_disconnect", new=AsyncMock()) as ad:
mock_device._loop = event_loop
mock_device._loop = get_event_loop()
mock_device.disconnect()
assert ad.call_count == 1

Expand Down