Skip to content

Commit b4da99c

Browse files
[TESTING] implementing use of new exception - part 1 of 2 (- WIP #157 -)
Changes in file tests/context.py: - checkPythonFuzzing -- now throws CommandExecutionError with exit code.
1 parent 32d557c commit b4da99c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/context.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,14 +585,16 @@ def checkPythonFuzzing(args, stderr=None): # skipcq: PYL-W0102 - [] != [None]
585585
theOutput = None
586586
try:
587587
if (args is None) or (args == [None]) or (len(args) <= 0): # pragma: no branch
588-
theOutput = subprocess.check_output(["exit 1 ; #"])
588+
theOutput = None
589+
_exc_msg = "No command arguments provided to execute."
590+
raise CommandExecutionError(str(_exc_msg), exit_code=66) from None
589591
else:
590592
if str("coverage") in args[0]:
591593
args = checkCovCommand(*args)
592594
theOutput = subprocess.check_output(args, stderr=stderr)
593595
except BaseException as err: # pragma: no branch
594596
theOutput = None
595-
raise RuntimeError(err) from err # do not suppress all errors
597+
raise CommandExecutionError(str(err), exit_code=2) from err # do not suppress errors
596598
theOutput = checkStrOrByte(theOutput)
597599
return theOutput
598600

0 commit comments

Comments
 (0)