summaryrefslogtreecommitdiff
path: root/tests/unit/test__logging.py
blob: 9248f861cdb63e1804c752246c1a9b7804626dbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import logging

import pytest

from gitlab import _logging


@pytest.fixture
def LOG():
    return logging.getLogger(_logging._module_root_logger_name)


def test_module_root_logger_name():
    assert _logging._module_root_logger_name == "gitlab"


def test_module_name(LOG):
    assert LOG.name == "gitlab"


def test_logger_null_handler(LOG):
    assert len(LOG.handlers) == 1
    handler = LOG.handlers[0]
    assert isinstance(handler, logging.NullHandler)