File: test_example.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 (10 lines) | stat: -rw-r--r-- 321 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
def test_example():
    """Tests the usage example from the README"""
    import colorlog

    handler = colorlog.StreamHandler()
    handler.setFormatter(
        colorlog.ColoredFormatter("%(log_color)s%(levelname)s:%(name)s:%(message)s")
    )
    logger = colorlog.getLogger("example")
    logger.addHandler(handler)