From 17fbe41b0342ba9f30a42354ec489cf049c2c0c3 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 7 Oct 2020 14:57:10 +0200 Subject: [PATCH] test/api: check api.exception exits the process The `api.exception` method, which is internally also used by `api.exception_handler` helper, calls `sys.exit` and this no statement after a call to either method should be reached. Add an assertion to make sure of that. --- test/mod/test_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/mod/test_api.py b/test/mod/test_api.py index decb464f..be825ec5 100644 --- a/test/mod/test_api.py +++ b/test/mod/test_api.py @@ -89,6 +89,7 @@ class TestAPI(unittest.TestCase): def exception(path): with osbuild.api.exception_handler(path): raise ValueError("osbuild test exception") + assert False, "api.exception should exit process" api = osbuild.api.API(args, monitor, socket_address=path) with api: