From 0b6a92150caa450e6cef40c21a5e8ba1b4be4b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 13 Oct 2022 04:26:22 +0200 Subject: [PATCH] tests/fpcmoc: Ensure python tests exit with error on every exception We ignored assertions happening on callbacks as they only raise exceptions that does not stop the execution. So ensure that this is happening in all the tests as synaptics was doing already Same as commit: be8888431 --- tests/fpcmoc/custom.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/fpcmoc/custom.py b/tests/fpcmoc/custom.py index c99dbd0..709ba93 100755 --- a/tests/fpcmoc/custom.py +++ b/tests/fpcmoc/custom.py @@ -1,9 +1,15 @@ #!/usr/bin/python3 +import traceback +import sys import gi + gi.require_version('FPrint', '2.0') from gi.repository import FPrint, GLib +# Exit with error on any exception, included those happening in async callbacks +sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1)) + ctx = GLib.main_context_default() c = FPrint.Context()