From b08804e7c82c33ba8afe8613e98e88a3ec595116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 4 Jan 2019 13:01:47 +0100 Subject: [PATCH] tests/extra: wrap ProcessWrapper.wait() to be asyncio-aware The user of ExtraTestCase don't need to know anything about asyncio. vm.run().wait() normally is a coroutine, but provide a wrapper that handle asyncio. This fixes FD leak in input proxy tests. --- qubes/tests/extra.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubes/tests/extra.py b/qubes/tests/extra.py index d4ee2f34..fe61e0bd 100644 --- a/qubes/tests/extra.py +++ b/qubes/tests/extra.py @@ -43,6 +43,9 @@ class ProcessWrapper(object): def communicate(self, input=None): return self._loop.run_until_complete(self._proc.communicate(input)) + def wait(self): + return self._loop.run_until_complete(self._proc.wait()) + class VMWrapper(object): '''Wrap VM object to provide stable API for basic operations''' def __init__(self, vm, loop=None):