@@ -64,11 +64,9 @@ def test_one(self, testObj):
64
64
with open (self .testcase_dir / outputFn , encoding = "utf8" ) as f :
65
65
outputData = f .read ()
66
66
if not outputData :
67
- logging .error ("Output data missing for " + outputFn )
68
- raise Exception
67
+ raise Exception (f"Output data missing for { outputFn } " )
69
68
if not outputType :
70
- logging .error ("Output file %s does not have a file extension" % outputFn )
71
- raise Exception
69
+ raise Exception (f"Output file { outputFn } does not have a file extension" )
72
70
73
71
# Run the test
74
72
res = subprocess .run (execrun , capture_output = True , text = True , input = inputData )
@@ -107,20 +105,17 @@ def test_one(self, testObj):
107
105
if "return_code" in testObj :
108
106
wantRC = testObj ['return_code' ]
109
107
if res .returncode != wantRC :
110
- logging .error (f"Return code mismatch for { outputFn } ; res: { str (res )} " )
111
- raise Exception
108
+ raise Exception (f"Return code mismatch for { outputFn } ; res: { str (res )} " )
112
109
113
110
if "error_txt" in testObj :
114
111
want_error = testObj ["error_txt" ]
115
112
# A partial match instead of an exact match makes writing tests easier
116
113
# and should be sufficient.
117
114
if want_error not in res .stderr :
118
- logging .error (f"Error mismatch:\n Expected: { want_error } \n Received: { res .stderr .rstrip ()} \n res: { str (res )} " )
119
- raise Exception
115
+ raise Exception (f"Error mismatch:\n Expected: { want_error } \n Received: { res .stderr .rstrip ()} \n res: { str (res )} " )
120
116
else :
121
117
if res .stderr :
122
- logging .error (f"Unexpected error received: { res .stderr .rstrip ()} \n res: { str (res )} " )
123
- raise Exception
118
+ raise Exception (f"Unexpected error received: { res .stderr .rstrip ()} \n res: { str (res )} " )
124
119
125
120
126
121
def parse_output (a , fmt ):
0 commit comments