Skip to main content

Сaptures loguru logging output

Project description


Сaptures loguru logging output.

Source: Making things work with Pytest and caplog


from loguru_caplog import loguru_caplog as caplog

# `some_func` adds two numbers, and logs a warning if the first is < 1
def test_some_func_logs_warning(caplog):
    assert some_func(-1, 3) == 2
    assert "Oh no!" in caplog.text

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for loguru-caplog, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size loguru_caplog-0.2.0-py3-none-any.whl (3.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size loguru-caplog-0.2.0.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page