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

Function test_logging_emit_error_supressed

testing/logging/test_reporting.py:1144–1157  ·  view source on GitHub ↗

If logging is configured to silently ignore errors, pytest doesn't propagate errors either.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1142
1143
1144def test_logging_emit_error_supressed(pytester: Pytester) -> None:
1145 """If logging is configured to silently ignore errors, pytest
1146 doesn't propagate errors either."""
1147 pytester.makepyfile(
1148 """
1149 import logging
1150
1151 def test_bad_log(monkeypatch):
1152 monkeypatch.setattr(logging, 'raiseExceptions', False)
1153 logging.warning('oops', 'first', 2)
1154 """
1155 )
1156 result = pytester.runpytest()
1157 result.assert_outcomes(passed=1)
1158
1159
1160def test_log_file_cli_subdirectories_are_successfully_created(

Callers

nothing calls this directly

Calls 3

assert_outcomesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected