(caplog: pytest.LogCaptureFixture)
| 18 | |
| 19 | |
| 20 | def test_duplicate_key_is_suppressed(caplog: pytest.LogCaptureFixture) -> None: |
| 21 | logger = logging.getLogger('crawlee.tests.log_dedup_duplicate') |
| 22 | logger_once = LoggerOnce(logger) |
| 23 | with caplog.at_level(logging.INFO, logger=logger.name): |
| 24 | logger_once.log('first', key='k1') |
| 25 | logger_once.log('second', key='k1') |
| 26 | assert [r.getMessage() for r in caplog.records] == ['first'] |
| 27 | |
| 28 | |
| 29 | def test_distinct_keys_each_log(caplog: pytest.LogCaptureFixture) -> None: |
nothing calls this directly
no test coverage detected