@@ -248,6 +248,7 @@ def __init__(self, config, file=None):
248
248
self .isatty = file .isatty ()
249
249
self ._progress_nodeids_reported = set ()
250
250
self ._show_progress_info = self ._determine_show_progress_info ()
251
+ self ._collect_report_last_write = None
251
252
252
253
def _determine_show_progress_info (self ):
253
254
"""Return True if we should display progress information based on the current config"""
@@ -474,7 +475,11 @@ def _width_of_current_line(self):
474
475
return self ._tw .chars_on_current_line
475
476
476
477
def pytest_collection (self ):
477
- if not self .isatty and self .config .option .verbose >= 1 :
478
+ if self .isatty :
479
+ if self .config .option .verbose >= 0 :
480
+ self .write ("collecting ... " , bold = True )
481
+ self ._collect_report_last_write = time .time ()
482
+ elif self .config .option .verbose >= 1 :
478
483
self .write ("collecting ... " , bold = True )
479
484
480
485
def pytest_collectreport (self , report ):
@@ -485,13 +490,19 @@ def pytest_collectreport(self, report):
485
490
items = [x for x in report .result if isinstance (x , pytest .Item )]
486
491
self ._numcollected += len (items )
487
492
if self .isatty :
488
- # self.write_fspath_result(report.nodeid, 'E')
489
493
self .report_collect ()
490
494
491
495
def report_collect (self , final = False ):
492
496
if self .config .option .verbose < 0 :
493
497
return
494
498
499
+ if not final :
500
+ # Only write "collecting" report every 0.5s.
501
+ t = time .time ()
502
+ if self ._collect_report_last_write > t - 0.5 :
503
+ return
504
+ self ._collect_report_last_write = t
505
+
495
506
errors = len (self .stats .get ("error" , []))
496
507
skipped = len (self .stats .get ("skipped" , []))
497
508
deselected = len (self .stats .get ("deselected" , []))
0 commit comments