MCPcopy
hub / github.com/pytest-dev/pytest / _log_cli_enabled

Method _log_cli_enabled

src/_pytest/logging.py:774–787  ·  view source on GitHub ↗

Return whether live logging is enabled.

(self)

Source from the content-addressed store, hash-verified

772 old_stream.close()
773
774 def _log_cli_enabled(self) -> bool:
775 """Return whether live logging is enabled."""
776 enabled = self._config.getoption(
777 "--log-cli-level"
778 ) is not None or self._config.getini("log_cli")
779 if not enabled:
780 return False
781
782 terminal_reporter = self._config.pluginmanager.get_plugin("terminalreporter")
783 if terminal_reporter is None:
784 # terminal reporter is disabled e.g. by pytest-xdist.
785 return False
786
787 return True
788
789 @hookimpl(wrapper=True, tryfirst=True)
790 def pytest_sessionstart(self) -> Generator[None]:

Callers 2

__init__Method · 0.95
pytest_runtestloopMethod · 0.95

Calls 2

getoptionMethod · 0.80
getiniMethod · 0.45

Tested by

no test coverage detected