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

Function logging_during_setup_and_teardown

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

Source from the content-addressed store, hash-verified

153
154@pytest.fixture
155def logging_during_setup_and_teardown(caplog):
156 caplog.set_level("INFO")
157 logger.info("a_setup_log")
158 yield
159 logger.info("a_teardown_log")
160 assert [x.message for x in caplog.get_records("teardown")] == ["a_teardown_log"]
161
162
163def test_caplog_captures_for_all_stages(caplog, logging_during_setup_and_teardown):

Callers

nothing calls this directly

Calls 2

set_levelMethod · 0.80
get_recordsMethod · 0.80

Tested by

no test coverage detected