mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge bitcoin/bitcoin#32286: test: Handle empty string returned by CLI as None in RPC tests
a4041c77f0
test: Handle empty string returned by CLI as None in RPC tests (Brandon Odiwuor) Pull request description: Partially Fixes https://github.com/bitcoin/bitcoin/issues/32264 Some tests are failing when `bitcoin-cli` returns an empty string. This change treats an empty response as `None`. See https://github.com/bitcoin/bitcoin/issues/32264#issuecomment-2807616694 This fixes the error for: - feature_bip68_sequence.py - feature_nulldummy.py - feature_signet.py - mining_mainnet.py - rpc_scanblocks.py - rpc_scantxoutset.py - wallet_descriptor.py --descriptors ACKs for top commit: maflcko: lgtm ACKa4041c77f0
achow101: ACKa4041c77f0
pablomartin4btc: ACKa4041c77f0
mzumsande: ACKa4041c77f0
Tree-SHA512: 2f1a416a18e0b3eebdb014c2e2e8dadf1d46b15c231cb61f577d47f5e551994ab0e2aeb7c179c01be7c1f07ebc03476236d29cf2d04c358ffb1fae985aa385c9
This commit is contained in:
commit
eb6b1003c1
1 changed files with 2 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue