2022-07-28 01:06:46 -07:00
|
|
|
# SPDX-FileCopyrightText: 2022 James R. Barlow
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
2021-01-09 16:02:12 -08:00
|
|
|
|
2022-07-23 00:39:24 -07:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2021-01-09 16:02:12 -08:00
|
|
|
import logging
|
|
|
|
|
2023-10-19 02:34:56 -07:00
|
|
|
from ocrmypdf._pipelines._common import configure_debug_logging
|
2021-01-09 16:02:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_debug_logging(tmp_path):
|
|
|
|
# Just exercise the debug logger but don't validate it
|
|
|
|
# See https://github.com/pytest-dev/pytest/issues/5502 for pytest logging quirks
|
|
|
|
prefix = 'test_debug_logging'
|
|
|
|
log = logging.getLogger(prefix)
|
2023-11-09 16:02:41 -08:00
|
|
|
_handler, remover = configure_debug_logging(tmp_path / 'test.log', prefix)
|
2021-01-09 16:02:12 -08:00
|
|
|
log.info("test message")
|
2023-11-09 16:02:41 -08:00
|
|
|
remover()
|