4343EXIT_SUCCESS = 0
4444EXIT_ERROR = 1
4545
46+
4647@dataclass
4748class CommandOutput :
4849 stdout : Any
@@ -60,6 +61,7 @@ def testComponent(value, exp):
6061
6162 return value == exp
6263
64+
6365# checks if valgrind is installed
6466def check_valgrind ():
6567 process = Popen (VALGRINDTEST + " --version" ,
@@ -131,7 +133,8 @@ def test(self):
131133 # are equal to the ones found in the testfile
132134 self .testPassed = all (
133135 testComponent (asdict (self .commandOutput )[k ], exp )
134- for k , exp in self .expected .items ())
136+ for k , exp in self .expected .items ()
137+ )
135138 return self .testPassed
136139
137140 def _printVerbose (self , output : TextIO ):
@@ -146,7 +149,7 @@ def _printVerbose(self, output: TextIO):
146149 print ("expected:" , file = output )
147150 print ("nothing" if exp is False else
148151 "something" if exp is True else
149- f"{ exp !r} " ,file = output )
152+ f"{ exp !r} " , file = output )
150153 print ("got:" , file = output )
151154
152155 header = RED if itemFail else ""
@@ -167,7 +170,6 @@ def _printConcise(self, output: TextIO):
167170 text = f"{ self .testIndex } : { result } \t { shlex .join (self .arguments )} "
168171 print (f"{ header } { text } { footer } " , file = output )
169172
170-
171173 def printDetail (self , verbose : bool = False , failed : bool = False ):
172174 output : TextIO = sys .stderr if failed else sys .stdout
173175 if verbose :
@@ -221,7 +223,7 @@ def main(argc, argv):
221223 cmdfilter = argv [1 ]
222224
223225 if runWithValgrind and not check_valgrind ():
224- print (f' Error: { VALGRINDTEST } is not installed!' , file = sys .stderr )
226+ print (f" Error: { VALGRINDTEST } is not installed!" , file = sys .stderr )
225227 return EXIT_ERROR
226228
227229 print (f"Using trurl binary: '{ baseCmd } '" )
@@ -240,7 +242,7 @@ def main(argc, argv):
240242 stdout = PIPE , stderr = PIPE ,
241243 encoding = "utf-8"
242244 )
243- features = output .stdout .split (' \n ' )[1 ].split ()[1 :]
245+ features = output .stdout .split (" \n " )[1 ].split ()[1 :]
244246
245247 numTestsFailed = 0
246248 numTestsPassed = 0
@@ -282,12 +284,12 @@ def main(argc, argv):
282284 f"Skipped: { numTestsSkipped } " ,
283285 f"Total: { len (testIndexesToRun )} "
284286 ])
285- if ( numTestsFailed == 0 ) :
287+ if numTestsFailed == 0 :
286288 print ("Passed! - " , result )
287289 else :
288290 ret = f"Failed! - { result } "
289291 else :
290- ret = f" error: File \ "{ baseCmd } \ " not found!"
292+ ret = f' error: File "{ baseCmd } " not found!'
291293 return ret
292294
293295
0 commit comments