1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-11 20:24:04 +03:00

3 Commits

Author SHA1 Message Date
Daniel P. Berrangé
438b86fda1 tests: expand AIO tests and add more comments
Add a test for one more usage scenario that was possible in the past,
whereby libvirt events are registered before starting the asyncio
loop, but we let libvirt find the loop associated with the current
thread.

Skip the test relies on auto-creating an event loop with Python >= 3.10
since it now triggers a deprecation warning which will soon turn into a
RuntimeError.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-08 16:43:52 +01:00
Daniel P. Berrangé
e3fab09382 tests: use mocks to allow calling virEventRegisterImpl many times
We currently have to run each of the test_aio.py test cases in a
separate process, because libvirt.virEventRegisterImpl can only be
called once per process. This leads to quite unpleasant console
output when running tests.

By introducing a mock for libvirt.virEventRegisterImpl we can
regain the ability to run everything in a single process. The only
caveat is that it relies on tests to fully cleanup, but in practice
this is ok for our current tests.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-08 16:43:52 +01:00
Chris Gunn
b9f79758c9 tests: add libvirtaio test coverage
Signed-off-by: Chris Gunn <chrisgun@microsoft.com>
2022-06-08 16:43:52 +01:00