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

Function test_change_level

testing/logging/test_fixture.py:16–28  ·  view source on GitHub ↗
(caplog)

Source from the content-addressed store, hash-verified

14
15
16def test_change_level(caplog):
17 caplog.set_level(logging.INFO)
18 logger.debug("handler DEBUG level")
19 logger.info("handler INFO level")
20
21 caplog.set_level(logging.CRITICAL, logger=sublogger.name)
22 sublogger.warning("logger WARNING level")
23 sublogger.critical("logger CRITICAL level")
24
25 assert "DEBUG" not in caplog.text
26 assert "INFO" in caplog.text
27 assert "WARNING" not in caplog.text
28 assert "CRITICAL" in caplog.text
29
30
31def test_change_level_undo(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 1

set_levelMethod · 0.80

Tested by

no test coverage detected