[Pkg-bitcoin-commits] [bitcoin] 28/126: [test] Replace check_output with low level version

Jonas Smedegaard dr at jones.dk
Mon Nov 13 20:01:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.15.1_dfsg-1
in repository bitcoin.

commit 2b97b36e5d37c6935dce112f90213f4f49cd88ad
Author: João Barbosa <joao.paulo.barbosa at gmail.com>
Date:   Wed Sep 6 16:36:13 2017 +0100

    [test] Replace check_output with low level version
    
    Github-Pull: #11125
    Rebased-From: ce379b47b92d6c04250c21719bb1abfb41c586ad
---
 test/functional/test_framework/test_node.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 3630257..12dab57 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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/bitcoin.git



More information about the Pkg-bitcoin-commits mailing list