MCPcopy Create free account
hub / github.com/pytest-dev/pytest / _log_cli_enabled

Method _log_cli_enabled

src/_pytest/logging.py:639–652  ·  view source on GitHub ↗

Return whether live logging is enabled.

(self)

Source from the content-addressed store, hash-verified

637 old_stream.close() # type:ignore[attr-defined]
638
639 def _log_cli_enabled(self):
640 """Return whether live logging is enabled."""
641 enabled = self._config.getoption(
642 "--log-cli-level"
643 ) is not None or self._config.getini("log_cli")
644 if not enabled:
645 return False
646
647 terminal_reporter = self._config.pluginmanager.get_plugin("terminalreporter")
648 if terminal_reporter is None:
649 # terminal reporter is disabled e.g. by pytest-xdist.
650 return False
651
652 return True
653
654 @hookimpl(hookwrapper=True, tryfirst=True)
655 def pytest_sessionstart(self) -> Generator[None, None, None]:

Callers 2

__init__Method · 0.95
pytest_runtestloopMethod · 0.95

Calls 2

getoptionMethod · 0.45
getiniMethod · 0.45

Tested by

no test coverage detected