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:
Mose Müller
2025-05-20 13:54:37 +02:00
parent 57cfe45c76
commit c32b6a8694
7 changed files with 84 additions and 54 deletions

View File

@ -207,7 +207,7 @@ def test_ColouredEnum_serialize() -> None:
}
@pytest.mark.asyncio(scope="module")
@pytest.mark.asyncio(loop_scope="module")
async def test_method_serialization() -> None:
class ClassWithMethod(pydase.DataService):
def some_method(self) -> str: