pytest-logdog

Pytest plugin to test logging


License
MIT
Install
pip install pytest-logdog==0.1.0

Documentation

pytest-logdog: Pytest plugin to test logging

Usage

pytest_plugins = ["pytest_logdog"]

def test_it_works(logdog):
    with logdog() as pile:
        logging.info("Hello world!")
    [rec] = pile.drain(message="Hello.*")
    assert rec.levelno == logging.INFO
    assert pile.is_empty()

Links