MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_first_call_logs

Function test_first_call_logs

tests/unit/_utils/test_log.py:12–17  ·  view source on GitHub ↗
(caplog: pytest.LogCaptureFixture)

Source from the content-addressed store, hash-verified

10
11
12def test_first_call_logs(caplog: pytest.LogCaptureFixture) -> None:
13 logger = logging.getLogger('crawlee.tests.log_dedup_first')
14 logger_once = LoggerOnce(logger)
15 with caplog.at_level(logging.INFO, logger=logger.name):
16 logger_once.log('first', key='k1')
17 assert [r.getMessage() for r in caplog.records] == ['first']
18
19
20def test_duplicate_key_is_suppressed(caplog: pytest.LogCaptureFixture) -> None:

Callers

nothing calls this directly

Calls 2

logMethod · 0.95
LoggerOnceClass · 0.90

Tested by

no test coverage detected