@@ -766,13 +766,13 @@ def report_collect(self, final: bool = False) -> None:
766
766
str (self ._numcollected ) + " item" + ("" if self ._numcollected == 1 else "s" )
767
767
)
768
768
if errors :
769
- line += " / %d error%s" % ( errors , "s" if errors != 1 else "" )
769
+ line += f " / { errors } error{ 's' if errors != 1 else '' } "
770
770
if deselected :
771
- line += " / %d deselected" % deselected
771
+ line += f " / { deselected } deselected"
772
772
if skipped :
773
- line += " / %d skipped" % skipped
773
+ line += f " / { skipped } skipped"
774
774
if self ._numcollected > selected :
775
- line += " / %d selected" % selected
775
+ line += f " / { selected } selected"
776
776
if self .isatty :
777
777
self .rewrite (line , bold = True , erase = True )
778
778
if final :
@@ -862,7 +862,7 @@ def _printcollecteditems(self, items: Sequence[Item]) -> None:
862
862
if test_cases_verbosity < - 1 :
863
863
counts = Counter (item .nodeid .split ("::" , 1 )[0 ] for item in items )
864
864
for name , count in sorted (counts .items ()):
865
- self ._tw .line ("%s: %d" % ( name , count ) )
865
+ self ._tw .line (f" { name } : { count } " )
866
866
else :
867
867
for item in items :
868
868
self ._tw .line (item .nodeid )
@@ -1254,11 +1254,9 @@ def show_skipped_folded(lines: list[str]) -> None:
1254
1254
if reason .startswith (prefix ):
1255
1255
reason = reason [len (prefix ) :]
1256
1256
if lineno is not None :
1257
- lines .append (
1258
- "%s [%d] %s:%d: %s" % (markup_word , num , fspath , lineno , reason )
1259
- )
1257
+ lines .append (f"{ markup_word } [{ num } ] { fspath } :{ lineno } : { reason } " )
1260
1258
else :
1261
- lines .append ("%s [%d] %s: %s" % ( markup_word , num , fspath , reason ) )
1259
+ lines .append (f" { markup_word } [ { num } ] { fspath } : { reason } " )
1262
1260
1263
1261
def show_skipped_unfolded (lines : list [str ]) -> None :
1264
1262
skipped : list [CollectReport ] = self .stats .get ("skipped" , [])
@@ -1375,7 +1373,7 @@ def _build_normal_summary_stats_line(
1375
1373
count = len (reports )
1376
1374
color = _color_for_type .get (key , _color_for_type_default )
1377
1375
markup = {color : True , "bold" : color == main_color }
1378
- parts .append (("%d %s" % pluralize (count , key ), markup ))
1376
+ parts .append (("%d %s" % pluralize (count , key ), markup )) # noqa: UP031
1379
1377
1380
1378
if not parts :
1381
1379
parts = [("no tests ran" , {_color_for_type_default : True })]
@@ -1394,7 +1392,7 @@ def _build_collect_only_summary_stats_line(
1394
1392
1395
1393
elif deselected == 0 :
1396
1394
main_color = "green"
1397
- collected_output = "%d %s collected" % pluralize (self ._numcollected , "test" )
1395
+ collected_output = "%d %s collected" % pluralize (self ._numcollected , "test" ) # noqa: UP031
1398
1396
parts = [(collected_output , {main_color : True })]
1399
1397
else :
1400
1398
all_tests_were_deselected = self ._numcollected == deselected
@@ -1410,7 +1408,7 @@ def _build_collect_only_summary_stats_line(
1410
1408
1411
1409
if errors :
1412
1410
main_color = _color_for_type ["error" ]
1413
- parts += [("%d %s" % pluralize (errors , "error" ), {main_color : True })]
1411
+ parts += [("%d %s" % pluralize (errors , "error" ), {main_color : True })] # noqa: UP031
1414
1412
1415
1413
return parts , main_color
1416
1414
0 commit comments