From 9b15b20cb17f048fedf3628dbb0e7c5db9561fc5 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 32a266586ad..26d052abab4 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -914,6 +914,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")