--- id: pytest-catchlog version: "1.2.2" license: MIT License license_treatment: permissive maintenance: abandoned --- # pytest-catchlog — py.test plugin to catch log messages. This is a fork of pytest-capturelog. License: permissive · Maintenance: abandoned · Downloads: 82.2K/mo ## What it is and what it does pytest-catchlog is a pytest plugin that intercepts log messages emitted during test execution and displays them in the test output when tests fail. It provides a caplog fixture that lets you set log levels, format log output, and access captured log records and text within your tests. The plugin was originally a fork of pytest-capturelog and supports both Python 2 and Python 3. The package integrates logging capture into pytest's standard output capture mechanism, showing logs alongside stdout and stderr in failure reports. You can customize log formatting via command-line options or pytest configuration files, disable log reporting entirely, and programmatically inspect or filter captured records within test code. However, modern pytest versions have absorbed this functionality into the core caplog fixture, making this package largely redundant for current projects. Use it for: - Debugging test failures by examining log output that was emitted during the test run. - Asserting on the content and severity of log messages within test code using caplog.records or caplog.text. - Customizing log message format and timestamps in pytest output for specific testing workflows. - Testing legacy code bases that require Python 2.6–3.5 and an older pytest version with explicit log capture. - Temporarily adjusting log levels within a test using caplog.at_level() context manager. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that automatically captures log messages during test runs and displays them alongside captured stdout and stderr when tests fail. No. The package is abandoned (last release 2016, last commit 2018) and modern pytest (since ~5.0) includes native logging capture via the caplog fixture, making this plugin unnecessary and potentially incompatible with current pytest versions. Install pytest's built-in caplog support instead. ## Install pip install pytest-catchlog uv add pytest-catchlog poetry add pytest-catchlog ## Installing pytest-catchlog Before you install: Low install friction with only py and pytest as runtime dependencies. However, the package is abandoned—last commit was 2018-01-27 and no releases since 2016-01-24. Modern pytest versions have integrated logging capture natively, making this plugin largely obsolete. License in practice: MIT License (permissive) places no significant restrictions on use, modification, or distribution. Quickstart: pip install pytest-catchlog # In your test file: import logging def test_example(caplog): caplog.set_level(logging.INFO) logging.info('test message') assert 'test message' in caplog.text This plugin targets older pytest versions and Python 2.6–3.5. Modern pytest (7.0+) has native logging capture; this package may conflict or behave unexpectedly with current pytest releases. Verify before relying: - Compatibility with pytest versions released after 2018; modern pytest includes native caplog fixture that may supersede this plugin. - Whether the package works reliably with Python 3.6 and later, given the last release was 2016 and classifiers only list up to 3.5. ## Package facts - License: MIT License (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 82.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest log capture plugin, capture logging in pytest, pytest test log output, pytest logging fixture, debug logs in pytest tests, pytest caplog alternative, legacy, pytest-plugin [View on SkillFed](https://skillfed.io/packages/pytest-catchlog) · [View on PyPI](https://pypi.org/project/pytest-catchlog/)