File: test_logging.py

package info (click to toggle)
pydot 4.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,820 kB
  • sloc: python: 2,727; sh: 12; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# SPDX-FileCopyrightText: 2025 pydot contributors
#
# SPDX-License-Identifier: MIT

"""Unit testing of pydot logging setup."""

import importlib
import logging

import pytest

import pydot


def test_logging_init(caplog: pytest.LogCaptureFixture) -> None:
    with caplog.at_level(logging.DEBUG, logger="pydot"):
        importlib.reload(pydot)
        importlib.reload(pydot.core)
        importlib.reload(pydot.dot_parser)
    assert caplog.record_tuples == [
        ("pydot", logging.DEBUG, "pydot initializing"),
        ("pydot", logging.DEBUG, f"pydot {pydot.__version__}"),
        ("pydot.core", logging.DEBUG, "pydot core module initializing"),
        (
            "pydot.dot_parser",
            logging.DEBUG,
            "pydot dot_parser module initializing",
        ),
    ]
    importlib.reload(pydot)