mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 12:42:05 +02:00
test: Use self.log
This is in line with all other functional tests.
This commit is contained in:
@ -9,7 +9,6 @@ from test_framework.test_framework import BitcoinTestFramework
|
|||||||
|
|
||||||
import difflib
|
import difflib
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -77,16 +76,16 @@ class ToolUtils(BitcoinTestFramework):
|
|||||||
try:
|
try:
|
||||||
a_parsed = parse_output(res.stdout, outputType)
|
a_parsed = parse_output(res.stdout, outputType)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error parsing command output as {outputType}: '{str(e)}'; res: {str(res)}")
|
self.log.error(f"Error parsing command output as {outputType}: '{str(e)}'; res: {str(res)}")
|
||||||
raise
|
raise
|
||||||
try:
|
try:
|
||||||
b_parsed = parse_output(outputData, outputType)
|
b_parsed = parse_output(outputData, outputType)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error('Error parsing expected output %s as %s: %s' % (outputFn, outputType, e))
|
self.log.error('Error parsing expected output %s as %s: %s' % (outputFn, outputType, e))
|
||||||
raise
|
raise
|
||||||
# Compare data
|
# Compare data
|
||||||
if a_parsed != b_parsed:
|
if a_parsed != b_parsed:
|
||||||
logging.error(f"Output data mismatch for {outputFn} (format {outputType}); res: {str(res)}")
|
self.log.error(f"Output data mismatch for {outputFn} (format {outputType}); res: {str(res)}")
|
||||||
data_mismatch = True
|
data_mismatch = True
|
||||||
# Compare formatting
|
# Compare formatting
|
||||||
if res.stdout != outputData:
|
if res.stdout != outputData:
|
||||||
@ -95,7 +94,7 @@ class ToolUtils(BitcoinTestFramework):
|
|||||||
res.stdout.splitlines(True),
|
res.stdout.splitlines(True),
|
||||||
fromfile=outputFn,
|
fromfile=outputFn,
|
||||||
tofile="returned"))
|
tofile="returned"))
|
||||||
logging.error(error_message)
|
self.log.error(error_message)
|
||||||
formatting_mismatch = True
|
formatting_mismatch = True
|
||||||
|
|
||||||
assert not data_mismatch and not formatting_mismatch
|
assert not data_mismatch and not formatting_mismatch
|
||||||
|
Reference in New Issue
Block a user