@@ -143,12 +143,6 @@ def pytest_addoption(parser):
143
143
default = "progress" ,
144
144
)
145
145
146
- parser .addini (
147
- "progress_display_mode" ,
148
- help = "Controls how to show the test progress (percentage|count)" ,
149
- default = "percentage" ,
150
- )
151
-
152
146
153
147
def pytest_configure (config ):
154
148
reporter = TerminalReporter (config , sys .stdout )
@@ -260,10 +254,7 @@ def _determine_show_progress_info(self):
260
254
# do not show progress if we are showing fixture setup/teardown
261
255
if self .config .getoption ("setupshow" ):
262
256
return False
263
- return (
264
- self .config .getini ("console_output_style" ) == "progress"
265
- or self .config .getini ("console_output_style" ) == "count"
266
- )
257
+ return self .config .getini ("console_output_style" ) in ("progress" , "count" )
267
258
268
259
def hasopt (self , char ):
269
260
char = {"xfailed" : "x" , "skipped" : "s" }.get (char , char )
@@ -415,11 +406,9 @@ def pytest_runtest_logreport(self, report):
415
406
def pytest_runtest_logfinish (self , nodeid ):
416
407
if self .config .getini ("console_output_style" ) == "count" :
417
408
num_tests = self ._session .testscollected
418
- _PROGRESS_LENGTH = len (
419
- " [ {} / {} ]" .format (str (num_tests ), str (num_tests ))
420
- )
409
+ progress_length = len (" [{}/{}]" .format (str (num_tests ), str (num_tests )))
421
410
else :
422
- _PROGRESS_LENGTH = len (" [100%]" )
411
+ progress_length = len (" [100%]" )
423
412
424
413
if self .verbosity <= 0 and self ._show_progress_info :
425
414
self ._progress_nodeids_reported .add (nodeid )
@@ -430,7 +419,7 @@ def pytest_runtest_logfinish(self, nodeid):
430
419
self ._write_progress_information_filling_space ()
431
420
else :
432
421
past_edge = (
433
- self ._tw .chars_on_current_line + _PROGRESS_LENGTH + 1
422
+ self ._tw .chars_on_current_line + progress_length + 1
434
423
>= self ._screen_width
435
424
)
436
425
if past_edge :
@@ -445,7 +434,7 @@ def _get_progress_information_message(self):
445
434
if collected :
446
435
progress = self ._progress_nodeids_reported
447
436
counter_format = "{{:{}d}}" .format (len (str (collected )))
448
- format_string = " [ {} / {{}} ]" .format (counter_format )
437
+ format_string = " [{}/ {{}}]" .format (counter_format )
449
438
return format_string .format (len (progress ), collected )
450
439
return " [ {} / {} ]" .format (collected , collected )
451
440
else :
0 commit comments