aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2017-09-06 16:36:13 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2017-09-07 00:35:28 +0100
commitce379b47b92d6c04250c21719bb1abfb41c586ad (patch)
tree6ebfbf3e22f1aa95419f9a0db3627ffaab075a99 /test
parent232e3e8471edb346c09f906c996b2f350cabc72a (diff)
[test] Replace check_output with low level version
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/test_framework/test_node.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 363025740a..12dab57a02 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -181,5 +181,10 @@ class TestNodeCLI():
if named_args:
p_args += ["-named"]
p_args += [command] + pos_args + named_args
- cli_output = subprocess.check_output(p_args, input=self.input, universal_newlines=True)
- return json.loads(cli_output, parse_float=decimal.Decimal)
+ process = subprocess.Popen(p_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
+ cli_stdout, cli_stderr = process.communicate(input=self.input)
+ returncode = process.poll()
+ if returncode:
+ # Ignore cli_stdout, raise with cli_stderr
+ raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr)
+ return json.loads(cli_stdout, parse_float=decimal.Decimal)