diff --git a/tests/test_device.py b/tests/test_device.py index 4a61027..e732966 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -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 @@ -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