@@ -254,7 +254,10 @@ def _determine_show_progress_info(self):
254254 # do not show progress if we are showing fixture setup/teardown
255255 if self .config .getoption ("setupshow" , False ):
256256 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
258261
259262 @property
260263 def verbosity (self ):
@@ -438,13 +441,13 @@ def pytest_runtest_logreport(self, report):
438441 self .currentfspath = - 2
439442
440443 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-
447444 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+
448451 self ._progress_nodeids_reported .add (nodeid )
449452 last_item = (
450453 len (self ._progress_nodeids_reported ) == self ._session .testscollected
@@ -460,7 +463,7 @@ def pytest_runtest_logfinish(self, nodeid):
460463
461464 def _get_progress_information_message (self ):
462465 collected = self ._session .testscollected
463- if self .config . getini ( "console_output_style" ) == "count" :
466+ if self ._show_progress_info == "count" :
464467 if collected :
465468 progress = self ._progress_nodeids_reported
466469 counter_format = "{{:{}d}}" .format (len (str (collected )))
0 commit comments