@@ -64,11 +64,9 @@ def test_one(self, testObj):
6464 with open (self .testcase_dir / outputFn , encoding = "utf8" ) as f :
6565 outputData = f .read ()
6666 if not outputData :
67- logging .error ("Output data missing for " + outputFn )
68- raise Exception
67+ raise Exception (f"Output data missing for { outputFn } " )
6968 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" )
7270
7371 # Run the test
7472 res = subprocess .run (execrun , capture_output = True , text = True , input = inputData )
@@ -107,20 +105,17 @@ def test_one(self, testObj):
107105 if "return_code" in testObj :
108106 wantRC = testObj ['return_code' ]
109107 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 )} " )
112109
113110 if "error_txt" in testObj :
114111 want_error = testObj ["error_txt" ]
115112 # A partial match instead of an exact match makes writing tests easier
116113 # and should be sufficient.
117114 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 )} " )
120116 else :
121117 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 )} " )
124119
125120
126121def parse_output (a , fmt ):
0 commit comments