mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-09 04:13:33 +02:00
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:
@ -1123,8 +1123,8 @@ class FPrintdUtilsTest(FPrintdVirtualDeviceBaseTest):
|
||||
env=env,
|
||||
stdout=None,
|
||||
stderr=subprocess.STDOUT)
|
||||
self.addCleanup(self.utils_proc[name].terminate)
|
||||
self.addCleanup(self.utils_proc[name].wait)
|
||||
self.addCleanup(self.utils_proc[name].terminate)
|
||||
return self.utils_proc[name]
|
||||
|
||||
def test_vanished_client_operation_is_cancelled(self):
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user