Return whether we should display progress information based on the current config.
(
self,
)
| 408 | self._keyboardinterrupt_memo: ExceptionRepr | None = None |
| 409 | |
| 410 | def _determine_show_progress_info( |
| 411 | self, |
| 412 | ) -> Literal["progress", "count", "times", False]: |
| 413 | """Return whether we should display progress information based on the current config.""" |
| 414 | # do not show progress if we are not capturing output (#3038) unless explicitly |
| 415 | # overridden by progress-even-when-capture-no |
| 416 | if ( |
| 417 | self.config.getoption("capture", "no") == "no" |
| 418 | and self.config.getini("console_output_style") |
| 419 | != "progress-even-when-capture-no" |
| 420 | ): |
| 421 | return False |
| 422 | # do not show progress if we are showing fixture setup/teardown |
| 423 | if self.config.getoption("setupshow", False): |
| 424 | return False |
| 425 | cfg: str = self.config.getini("console_output_style") |
| 426 | if cfg in {"progress", "progress-even-when-capture-no"}: |
| 427 | return "progress" |
| 428 | elif cfg == "count": |
| 429 | return "count" |
| 430 | elif cfg == "times": |
| 431 | return "times" |
| 432 | else: |
| 433 | return False |
| 434 | |
| 435 | @property |
| 436 | def verbosity(self) -> int: |