Skip to content

Commit fa19861

Browse files
author
MarcoFalke
committed
test: Remove useless catch-throw
This is not done anywhere else in the tests for open or subprocess.run
1 parent fa2f1c5 commit fa19861

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

test/functional/tool_utils.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,8 @@ def test_one(self, testObj):
6161
if "output_cmp" in testObj:
6262
outputFn = testObj['output_cmp']
6363
outputType = os.path.splitext(outputFn)[1][1:] # output type from file extension (determines how to compare)
64-
try:
65-
with open(self.testcase_dir / outputFn, encoding="utf8") as f:
66-
outputData = f.read()
67-
except Exception:
68-
logging.error("Output file " + outputFn + " cannot be opened")
69-
raise
64+
with open(self.testcase_dir / outputFn, encoding="utf8") as f:
65+
outputData = f.read()
7066
if not outputData:
7167
logging.error("Output data missing for " + outputFn)
7268
raise Exception
@@ -75,11 +71,7 @@ def test_one(self, testObj):
7571
raise Exception
7672

7773
# Run the test
78-
try:
79-
res = subprocess.run(execrun, capture_output=True, text=True, input=inputData)
80-
except OSError:
81-
logging.error("OSError, Failed to execute " + str(execrun))
82-
raise
74+
res = subprocess.run(execrun, capture_output=True, text=True, input=inputData)
8375

8476
if outputData:
8577
data_mismatch, formatting_mismatch = False, False

0 commit comments

Comments
 (0)