mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-12 15:57:12 +02:00
tests: proper handling of event loops
Event loops have to be closed properly, otherwise pytest will throw a warning / error. Disconnecting clients and closing the server is important for that, as well as stopping tasks. Additionally, I had to add loop_scope parameters to share the event loop throughout modules which all use the same pydase.Server instance.
This commit is contained in:
@ -7,7 +7,7 @@ from pydase.task.autostart import autostart_service_tasks
|
||||
from pytest import LogCaptureFixture
|
||||
|
||||
|
||||
@pytest.mark.asyncio(scope="function")
|
||||
@pytest.mark.asyncio(loop_scope="function")
|
||||
async def test_reconnection(caplog: LogCaptureFixture) -> None:
|
||||
class MyService(pydase.components.device_connection.DeviceConnection):
|
||||
def __init__(
|
||||
|
Reference in New Issue
Block a user