@@ -140,19 +140,19 @@ def summary(self, stream):
140140
141141 # Output coverage section header.
142142 if len (self .node_descs ) == 1 :
143- self .sep (stream , '-' , ' coverage: %s' % '' .join (self .node_descs ))
143+ self .sep (stream , '-' , f" coverage: { '' .join (self .node_descs )} " )
144144 else :
145145 self .sep (stream , '-' , 'coverage' )
146146 for node_desc in sorted (self .node_descs ):
147- self .sep (stream , ' ' , '%s' % node_desc )
147+ self .sep (stream , ' ' , f' { node_desc } ' )
148148
149149 # Report on any failed workers.
150150 if self .failed_workers :
151151 self .sep (stream , '-' , 'coverage: failed workers' )
152152 stream .write ('The following workers failed to return coverage data, '
153153 'ensure that pytest-cov is installed on these workers.\n ' )
154154 for node in self .failed_workers :
155- stream .write ('%s \n ' % node .gateway .id )
155+ stream .write (f' { node .gateway .id } \n ' )
156156
157157 # Produce terminal report if wanted.
158158 if any (x in self .cov_report for x in ['term' , 'term-missing' ]):
@@ -178,7 +178,7 @@ def summary(self, stream):
178178 with _backup (self .cov , "config" ):
179179 total = self .cov .report (ignore_errors = True , file = _NullFile )
180180 if annotate_dir :
181- stream .write ('Coverage annotated source written to dir %s \n ' % annotate_dir )
181+ stream .write (f 'Coverage annotated source written to dir { annotate_dir } \n ' )
182182 else :
183183 stream .write ('Coverage annotated source written next to source\n ' )
184184
@@ -187,14 +187,14 @@ def summary(self, stream):
187187 output = self .cov_report ['html' ]
188188 with _backup (self .cov , "config" ):
189189 total = self .cov .html_report (ignore_errors = True , directory = output )
190- stream .write ('Coverage HTML written to dir %s \n ' % ( self .cov .config .html_dir if output is None else output ) )
190+ stream .write (f 'Coverage HTML written to dir { self .cov .config .html_dir if output is None else output } \n ' )
191191
192192 # Produce xml report if wanted.
193193 if 'xml' in self .cov_report :
194194 output = self .cov_report ['xml' ]
195195 with _backup (self .cov , "config" ):
196196 total = self .cov .xml_report (ignore_errors = True , outfile = output )
197- stream .write ('Coverage XML written to file %s \n ' % ( self .cov .config .xml_output if output is None else output ) )
197+ stream .write (f 'Coverage XML written to file { self .cov .config .xml_output if output is None else output } \n ' )
198198
199199 # Produce json report if wanted
200200 if 'json' in self .cov_report :
@@ -213,7 +213,7 @@ def summary(self, stream):
213213 # Coverage.lcov_report doesn't return any total and we need it for --cov-fail-under.
214214 total = self .cov .report (ignore_errors = True , file = _NullFile )
215215
216- stream .write ('Coverage LCOV written to file %s \n ' % ( self .cov .config .lcov_output if output is None else output ) )
216+ stream .write (f 'Coverage LCOV written to file { self .cov .config .lcov_output if output is None else output } \n ' )
217217
218218 return total
219219
0 commit comments