From a4041c77f0e20d004524868e70ff12508832c9eb 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 --- 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 52f6bbe2838..7416e08a1fd 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -919,6 +919,8 @@ class TestNodeCLI(): # Ignore cli_stdout, raise with cli_stderr raise subprocess.CalledProcessError(returncode, p_args, 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")