From dc1f7e204a4dbcd649e21ff8d38a31bce84c1cc4 Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Mon, 4 Mar 2019 16:54:37 +0100 Subject: [PATCH] Add returncode support to helper.make --- test/helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/helpers.py b/test/helpers.py index db984484..476cc260 100644 --- a/test/helpers.py +++ b/test/helpers.py @@ -26,11 +26,12 @@ def run_subprocess(command, working_dir='.', env=None, expected_returncode=0): env=env, ) print(result.stdout.decode('utf-8')) - assert(result.returncode == expected_returncode) + assert result.returncode == expected_returncode, \ + "Got unexpected return code {}".format(result.returncode) return result.stdout.decode('utf-8') -def make(*args, working_dir='.', env=None, **kwargs): +def make(*args, working_dir='.', env=None, expected_returncode=0, **kwargs): """ Runs a make target in the specified working directory @@ -54,6 +55,7 @@ def make(*args, working_dir='.', env=None, **kwargs): ], working_dir=working_dir, env=env, + expected_returncode=expected_returncode, )