@@ -140,19 +140,19 @@ def summary(self, stream):
140
140
141
141
# Output coverage section header.
142
142
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 )} " )
144
144
else :
145
145
self .sep (stream , '-' , 'coverage' )
146
146
for node_desc in sorted (self .node_descs ):
147
- self .sep (stream , ' ' , '%s' % node_desc )
147
+ self .sep (stream , ' ' , f' { node_desc } ' )
148
148
149
149
# Report on any failed workers.
150
150
if self .failed_workers :
151
151
self .sep (stream , '-' , 'coverage: failed workers' )
152
152
stream .write ('The following workers failed to return coverage data, '
153
153
'ensure that pytest-cov is installed on these workers.\n ' )
154
154
for node in self .failed_workers :
155
- stream .write ('%s \n ' % node .gateway .id )
155
+ stream .write (f' { node .gateway .id } \n ' )
156
156
157
157
# Produce terminal report if wanted.
158
158
if any (x in self .cov_report for x in ['term' , 'term-missing' ]):
@@ -178,7 +178,7 @@ def summary(self, stream):
178
178
with _backup (self .cov , "config" ):
179
179
total = self .cov .report (ignore_errors = True , file = _NullFile )
180
180
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 ' )
182
182
else :
183
183
stream .write ('Coverage annotated source written next to source\n ' )
184
184
@@ -187,14 +187,14 @@ def summary(self, stream):
187
187
output = self .cov_report ['html' ]
188
188
with _backup (self .cov , "config" ):
189
189
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 ' )
191
191
192
192
# Produce xml report if wanted.
193
193
if 'xml' in self .cov_report :
194
194
output = self .cov_report ['xml' ]
195
195
with _backup (self .cov , "config" ):
196
196
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 ' )
198
198
199
199
# Produce json report if wanted
200
200
if 'json' in self .cov_report :
@@ -213,7 +213,7 @@ def summary(self, stream):
213
213
# Coverage.lcov_report doesn't return any total and we need it for --cov-fail-under.
214
214
total = self .cov .report (ignore_errors = True , file = _NullFile )
215
215
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 ' )
217
217
218
218
return total
219
219
0 commit comments