(caplog: pytest.LogCaptureFixture)
| 27 | |
| 28 | |
| 29 | def test_distinct_keys_each_log(caplog: pytest.LogCaptureFixture) -> None: |
| 30 | logger = logging.getLogger('crawlee.tests.log_dedup_distinct') |
| 31 | logger_once = LoggerOnce(logger) |
| 32 | with caplog.at_level(logging.INFO, logger=logger.name): |
| 33 | logger_once.log('msg-a', key='k1') |
| 34 | logger_once.log('msg-b', key='k2') |
| 35 | assert [r.getMessage() for r in caplog.records] == ['msg-a', 'msg-b'] |
| 36 | |
| 37 | |
| 38 | def test_separate_instances_have_independent_state(caplog: pytest.LogCaptureFixture) -> None: |
nothing calls this directly
no test coverage detected