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  ·  view source on GitHub ↗
(
    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("INFO")
301 logger.info("a_setup_log")
302 yield
303 logger.info("a_teardown_log")
304 assert [x.message for x in caplog.get_records("teardown")] == ["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

Used in the wild real call sites across dependent graphs

searching dependent graphs…