Skip to content

Commit ac70158

Browse files
committed
Fix pytest-asyncio usage
1 parent eaf0655 commit ac70158

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_device.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Test communicating with a devolo device."""
22

3-
from asyncio import AbstractEventLoop
3+
from asyncio import get_event_loop
44
from unittest.mock import AsyncMock, Mock, patch
55

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

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

0 commit comments

Comments
 (0)