File: test_wrappers.py

package info (click to toggle)
python-colorlog 6.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: python: 721; makefile: 5
file content (43 lines) | stat: -rw-r--r-- 1,209 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Test the colorlog.wrappers module."""

import logging

import colorlog


def test_logging_module(test_logger):
    test_logger(logging)


def test_colorlog_module(test_logger):
    test_logger(colorlog)


def test_colorlog_basicConfig(test_logger):
    colorlog.basicConfig()
    test_logger(colorlog.getLogger())


def test_reexports():
    assert colorlog.root is logging.root
    assert colorlog.getLogger is logging.getLogger
    assert colorlog.StreamHandler is logging.StreamHandler

    assert colorlog.CRITICAL is logging.CRITICAL
    assert colorlog.FATAL is logging.FATAL
    assert colorlog.ERROR is logging.ERROR
    assert colorlog.WARNING is logging.WARNING
    assert colorlog.WARN is logging.WARN
    assert colorlog.INFO is logging.INFO
    assert colorlog.DEBUG is logging.DEBUG
    assert colorlog.NOTSET is logging.NOTSET


def test_wrappers():
    assert colorlog.debug is not logging.debug
    assert colorlog.info is not logging.info
    assert colorlog.warning is not logging.warning
    assert colorlog.error is not logging.error
    assert colorlog.critical is not logging.critical
    assert colorlog.log is not logging.log
    assert colorlog.exception is not logging.exception