From 7e9aa9c9081f4da36344933101ded8328fa87200 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 30 May 2016 11:52:37 +0200 Subject: Squish: Silence warnings in tst_default_settings Change-Id: I668cc7b1fcb569b50d2178fe792f566721c9d4d4 Reviewed-by: Christian Stenger --- tests/system/shared/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 1429cb6c0f4..bdd64fcdcd8 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -139,7 +139,7 @@ def which(program): command = "where" else: command = "which" - foundPath = getOutputFromCmdline([command, program]) + foundPath = getOutputFromCmdline([command, program], acceptedError=1) if foundPath: return foundPath.splitlines()[0] else: @@ -216,11 +216,12 @@ def logApplicationOutput(): return None # get the output from a given cmdline call -def getOutputFromCmdline(cmdline, environment=None): +def getOutputFromCmdline(cmdline, environment=None, acceptedError=0): try: return subprocess.check_output(cmdline, env=environment) except subprocess.CalledProcessError as e: - test.warning("Command '%s' returned %d" % (e.cmd, e.returncode)) + if e.returncode != acceptedError: + test.warning("Command '%s' returned %d" % (e.cmd, e.returncode)) return e.output def selectFromFileDialog(fileName, waitForFile=False): -- cgit v1.2.3