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

Function test_change_level

testing/logging/test_fixture.py:35–47  ·  testing/logging/test_fixture.py::test_change_level
(caplog: pytest.LogCaptureFixture)

Source from the content-addressed store, hash-verified

33
34
35def test_change_level(caplog: pytest.LogCaptureFixture) -> None:
36 caplog.set_level(logging.INFO)
37 logger.debug(class="st">"handler DEBUG level")
38 logger.info(class="st">"handler INFO level")
39
40 caplog.set_level(logging.CRITICAL, logger=sublogger.name)
41 sublogger.warning(class="st">"logger WARNING level")
42 sublogger.critical(class="st">"logger CRITICAL level")
43
44 assert class="st">"DEBUG" not in caplog.text
45 assert class="st">"INFO" in caplog.text
46 assert class="st">"WARNING" not in caplog.text
47 assert class="st">"CRITICAL" in caplog.text
48
49
50def test_change_level_logging_disabled(caplog: pytest.LogCaptureFixture) -> None:

Callers

nothing calls this directly

Calls 1

set_levelMethod · 0.80

Tested by

no test coverage detected