tests/fprintd-utils: Call addCleanup actions in reverse order

unittest addCleanup calls are called in reverse order, so we need to reverse
the order of the calls as well, otherwise we won't correctly terminate the
subprocess children
This commit is contained in:
Marco Trevisan (Treviño)
2020-04-02 21:15:39 +02:00
parent 93bcac946e
commit 59b3d2af8d
2 changed files with 3 additions and 3 deletions

View File

@ -93,9 +93,9 @@ class TestFprintdUtilsBase(dbusmock.DBusTestCase):
flags = fcntl.fcntl(process.stdout, fcntl.F_GETFL)
fcntl.fcntl(process.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
self.addCleanup(lambda: print(process.stdout.read()))
self.addCleanup(process.terminate)
self.addCleanup(process.wait)
self.addCleanup(process.terminate)
self.addCleanup(lambda: print(process.stdout.read()))
if sleep:
time.sleep(self.sleep_time)