pytest-loguru
Pytest Loguru
Decision gist · record as of 2026-08-14
Yes. If you use loguru in your application and pytest for testing, this plugin is a straightforward, low-friction addition that removes a gap in test observability. It has no known vulnerabilities, active maintenance, and a permissive license. Install it if you need to assert on loguru output in tests.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with a single runtime dependency on loguru.
- Active maintenance with a recent release (90 days ago) and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
last release 2026-05-16 (90 days) · last repo commit 2026-05-16 · 33 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 302,970 downloads/mo, #7,817 on PyPI
Alternatives
Verify before relying
pip install pytest-loguru
import pytest
from loguru import logger
def test_logging(caplog):
logger.info("test message")
assert "test message" in caplog.text- Whether caplog integration works with all loguru sink types or only standard handlers
- Performance impact when capturing high-volume loguru output in large test suites
What it is and what it does
pytest-loguru is a pytest plugin that bridges loguru's structured logging with pytest's built-in caplog fixture. When you use loguru for logging in your application, pytest's standard caplog fixture does not capture those logs by default—this plugin solves that by making loguru logs available through caplog, so you can write assertions on them just as you would with the standard library's logging module.
The plugin is lightweight, requiring only loguru as a runtime dependency, and works across Python 3.8 through 3.12 on all major operating systems. It's maintained actively and carries no known security vulnerabilities, making it a straightforward addition to test suites that already use loguru for application logging.
Use it for
- Verify that your application logs specific messages at the correct log level during unit tests
- Assert that error or warning logs are emitted when expected in exception-handling code paths
- Capture and inspect structured log fields added by loguru in test assertions
- Ensure log output does not contain sensitive information before it reaches production
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
If you use loguru in your application and pytest for testing, this plugin is a straightforward, low-friction addition that removes a gap in test observability. It has no known vulnerabilities, active maintenance, and a permissive license. Install it if you need to assert on loguru output in tests.
Install
pytest-loguru on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency on loguru. Active maintenance with a recent release (90 days ago) and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
Quickstart
pip install pytest-loguru
import pytest
from loguru import logger
def test_logging(caplog):
logger.info("test message")
assert "test message" in caplog.text
Verify before relying
- Whether caplog integration works with all loguru sink types or only standard handlers
- Performance impact when capturing high-volume loguru output in large test suites
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageloguru |
| Maintenance | Actively maintained 90 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 302,970 / month, #7,817 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: pytest_loguru-0.4.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytest loguru integration”
- pytest-loguruExtends pytest's caplog fixture to capture and assert on logs…
- loki-logger-handlerA logging handler that sends Python log messages to Grafana Loki in…
- loguruLoguru provides a pre-configured logger that replaces Python's…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also pytest-catchlog · loguru · tdd-guard-pytest · pytest-faker · pytest-base-url · pytest-qt · pytest-print · pytest-runtime-xfail · pytest-subtests · pytest-raises