MCPcopy Index your code
hub / github.com/pytest-dev/pytest / test_change_level

Function test_change_level

testing/logging/test_fixture.py:35–47  ·  view source on GitHub ↗
(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("handler DEBUG level")
38 logger.info("handler INFO level")
39
40 caplog.set_level(logging.CRITICAL, logger=sublogger.name)
41 sublogger.warning("logger WARNING level")
42 sublogger.critical("logger CRITICAL level")
43
44 assert "DEBUG" not in caplog.text
45 assert "INFO" in caplog.text
46 assert "WARNING" not in caplog.text
47 assert "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

Used in the wild real call sites across dependent graphs

searching dependent graphs…