File: test_example.py

package info (click to toggle)
python-colorlog 2.10.0-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 168 kB
  • ctags: 87
  • sloc: python: 437; makefile: 5
file content (9 lines) | stat: -rw-r--r-- 316 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
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)