From 85f3e1de68e845937ebc3568e26c12fc6a027a18 Mon Sep 17 00:00:00 2001 From: Brandon Odiwuor Date: Wed, 16 Apr 2025 14:18:48 +0300 Subject: [PATCH] test: Handle empty string returned by CLI as None in RPC tests Github-Pull: #32286 Rebased-From: a4041c77f0e20d004524868e70ff12508832c9eb --- test/functional/test_framework/test_node.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index f7d6ba78d23..e7ae3851f02 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -913,6 +913,8 @@ class TestNodeCLI(): # Ignore cli_stdout, raise with cli_stderr raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr) try: + if not cli_stdout.strip(): + return None return json.loads(cli_stdout, parse_float=decimal.Decimal) except (json.JSONDecodeError, decimal.InvalidOperation): return cli_stdout.rstrip("\n")