mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
test: Remove useless catch-throw
This is not done anywhere else in the tests for open or subprocess.run
This commit is contained in:
@@ -61,12 +61,8 @@ class ToolUtils(BitcoinTestFramework):
|
|||||||
if "output_cmp" in testObj:
|
if "output_cmp" in testObj:
|
||||||
outputFn = testObj['output_cmp']
|
outputFn = testObj['output_cmp']
|
||||||
outputType = os.path.splitext(outputFn)[1][1:] # output type from file extension (determines how to compare)
|
outputType = os.path.splitext(outputFn)[1][1:] # output type from file extension (determines how to compare)
|
||||||
try:
|
with open(self.testcase_dir / outputFn, encoding="utf8") as f:
|
||||||
with open(self.testcase_dir / outputFn, encoding="utf8") as f:
|
outputData = f.read()
|
||||||
outputData = f.read()
|
|
||||||
except Exception:
|
|
||||||
logging.error("Output file " + outputFn + " cannot be opened")
|
|
||||||
raise
|
|
||||||
if not outputData:
|
if not outputData:
|
||||||
logging.error("Output data missing for " + outputFn)
|
logging.error("Output data missing for " + outputFn)
|
||||||
raise Exception
|
raise Exception
|
||||||
@@ -75,11 +71,7 @@ class ToolUtils(BitcoinTestFramework):
|
|||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
# Run the test
|
# Run the test
|
||||||
try:
|
res = subprocess.run(execrun, capture_output=True, text=True, input=inputData)
|
||||||
res = subprocess.run(execrun, capture_output=True, text=True, input=inputData)
|
|
||||||
except OSError:
|
|
||||||
logging.error("OSError, Failed to execute " + str(execrun))
|
|
||||||
raise
|
|
||||||
|
|
||||||
if outputData:
|
if outputData:
|
||||||
data_mismatch, formatting_mismatch = False, False
|
data_mismatch, formatting_mismatch = False, False
|
||||||
|
|||||||
Reference in New Issue
Block a user