From 072fbc2b465958550cdc6c5e4ce631f6ef315079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 14 Feb 2020 17:33:08 +0100 Subject: [PATCH] tests_fprintd_utils: Print the process output when done This is particularly useful when using valgrind or address sanitizer to read the output log --- tests/test_fprintd_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_fprintd_utils.py b/tests/test_fprintd_utils.py index 20a92a5..9475826 100755 --- a/tests/test_fprintd_utils.py +++ b/tests/test_fprintd_utils.py @@ -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)