@@ -254,7 +254,10 @@ def _determine_show_progress_info(self):
254
254
# do not show progress if we are showing fixture setup/teardown
255
255
if self .config .getoption ("setupshow" , False ):
256
256
return False
257
- return self .config .getini ("console_output_style" ) in ("progress" , "count" )
257
+ cfg = self .config .getini ("console_output_style" )
258
+ if cfg in ("progress" , "count" ):
259
+ return cfg
260
+ return False
258
261
259
262
@property
260
263
def verbosity (self ):
@@ -438,13 +441,13 @@ def pytest_runtest_logreport(self, report):
438
441
self .currentfspath = - 2
439
442
440
443
def pytest_runtest_logfinish (self , nodeid ):
441
- if self .config .getini ("console_output_style" ) == "count" :
442
- num_tests = self ._session .testscollected
443
- progress_length = len (" [{}/{}]" .format (str (num_tests ), str (num_tests )))
444
- else :
445
- progress_length = len (" [100%]" )
446
-
447
444
if self .verbosity <= 0 and self ._show_progress_info :
445
+ if self ._show_progress_info == "count" :
446
+ num_tests = self ._session .testscollected
447
+ progress_length = len (" [{}/{}]" .format (str (num_tests ), str (num_tests )))
448
+ else :
449
+ progress_length = len (" [100%]" )
450
+
448
451
self ._progress_nodeids_reported .add (nodeid )
449
452
last_item = (
450
453
len (self ._progress_nodeids_reported ) == self ._session .testscollected
@@ -460,7 +463,7 @@ def pytest_runtest_logfinish(self, nodeid):
460
463
461
464
def _get_progress_information_message (self ):
462
465
collected = self ._session .testscollected
463
- if self .config . getini ( "console_output_style" ) == "count" :
466
+ if self ._show_progress_info == "count" :
464
467
if collected :
465
468
progress = self ._progress_nodeids_reported
466
469
counter_format = "{{:{}d}}" .format (len (str (collected )))
0 commit comments