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

Function logging_during_setup_and_teardown

testing/logging/test_fixture.py:297–304  ·  testing/logging/test_fixture.py::logging_during_setup_and_teardown
(
    caplog: pytest.LogCaptureFixture,
)

Source from the content-addressed store, hash-verified

295
296@pytest.fixture
297def logging_during_setup_and_teardown(
298 caplog: pytest.LogCaptureFixture,
299) -> Iterator[None]:
300 caplog.set_level(class="st">"INFO")
301 logger.info(class="st">"a_setup_log")
302 yield
303 logger.info(class="st">"a_teardown_log")
304 assert [x.message for x in caplog.get_records(class="st">"teardown")] == [class="st">"a_teardown_log"]
305
306
307def private_assert_caplog_records_is_setup_call(

Callers

nothing calls this directly

Calls 2

set_levelMethod · 0.80
get_recordsMethod · 0.80

Tested by

no test coverage detected