tests_fprintd_utils: Print the process output when done

This is particularly useful when using valgrind or address sanitizer to read
the output log
This commit is contained in:
Marco Trevisan (Treviño)
2020-02-14 17:33:08 +01:00
committed by Bastien Nocera
parent 7846359b65
commit 072fbc2b46

View File

@ -84,6 +84,12 @@ class TestFprintd(dbusmock.DBusTestCase):
self.addCleanup(process.terminate)
self.addCleanup(process.wait)
def print_proc_log(mock_log):
with open(mock_log.name) as f:
print(f.read())
self.addCleanup(print_proc_log, mock_log)
if sleep:
time.sleep(self.sleep_time)