@@ -140,10 +140,7 @@ def main(argv=None):
140140 if not args .quiet :
141141 runner .print_results ()
142142
143- if runner .failures :
144- return 1
145- else :
146- return 0
143+ return 1 if runner .failures else 0
147144
148145
149146def print_configuration_info ():
@@ -152,8 +149,8 @@ def print_configuration_info():
152149 sys .path .append (os .path .abspath ("test/lib" ))
153150 import TestMac
154151
155- print (" Mac {} {}" . format ( platform .mac_ver ()[0 ], platform .mac_ver ()[2 ]) )
156- print (" Xcode %s" % TestMac .Xcode .Version ())
152+ print (f " Mac { platform .mac_ver ()[0 ]} { platform .mac_ver ()[2 ]} " )
153+ print (f " Xcode { TestMac .Xcode .Version ()} " )
157154 elif sys .platform == "win32" :
158155 sys .path .append (os .path .abspath ("pylib" ))
159156 import gyp .MSVSVersion
@@ -162,8 +159,8 @@ def print_configuration_info():
162159 print (" MSVS %s" % gyp .MSVSVersion .SelectVisualStudioVersion ().Description ())
163160 elif sys .platform in ("linux" , "linux2" ):
164161 print (" Linux %s" % " " .join (platform .linux_distribution ()))
165- print (" Python %s" % platform .python_version ())
166- print (" PYTHONPATH=%s" % os .environ [" PYTHONPATH" ] )
162+ print (f " Python { platform .python_version ()} " )
163+ print (f " PYTHONPATH={ os .environ [' PYTHONPATH' ] } " )
167164 print ()
168165
169166
@@ -222,13 +219,9 @@ def run_test(self, test, fmt, i):
222219 res_msg = f" { res } { took :.3f} s"
223220 self .print_ (res_msg )
224221
225- if (
226- stdout
227- and not stdout .endswith ("PASSED\n " )
228- and not (stdout .endswith ("NO RESULT\n " ))
229- ):
222+ if stdout and not stdout .endswith (("PASSED\n " , "NO RESULT\n " )):
230223 print ()
231- print ("\n " .join (" %s" % line for line in stdout .splitlines ()))
224+ print ("\n " .join (f " { line } " for line in stdout .splitlines ()))
232225 elif not self .isatty :
233226 print ()
234227
0 commit comments