Fix ZeroDivisionError with 0 collected tests
This can easily happen with pytest-testmon.
This commit is contained in:
parent
4d2f05e4b9
commit
0f5fb7ed05
|
@ -313,8 +313,11 @@ class TerminalReporter:
|
|||
_PROGRESS_LENGTH = len(' [100%]')
|
||||
|
||||
def _get_progress_information_message(self):
|
||||
progress = self._progress_items_reported * 100 // self._session.testscollected
|
||||
return ' [{:3d}%]'.format(progress)
|
||||
collected = self._session.testscollected
|
||||
if collected:
|
||||
progress = self._progress_items_reported * 100 // collected
|
||||
return ' [{:3d}%]'.format(progress)
|
||||
return ' [100%]'
|
||||
|
||||
def _write_progress_information_filling_space(self):
|
||||
if not self._show_progress_info:
|
||||
|
|
Loading…
Reference in New Issue