{"library":"pytest-loguru","title":"Pytest Loguru","description":"pytest-loguru is a pytest plugin that integrates Loguru with pytest's `caplog` fixture. It replaces the default `caplog` fixture to seamlessly capture log messages emitted by Loguru, allowing for easy assertion in tests. The current version is 0.4.0, and it maintains a moderate release cadence with updates addressing compatibility and minor improvements.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install pytest-loguru"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from loguru import logger\nimport pytest\n\ndef test_loguru_messages_captured(caplog):\n    logger.info(\"This is an info message from Loguru\")\n    logger.warning(\"This is a warning message from Loguru\")\n    assert \"This is an info message from Loguru\" in caplog.text\n    assert \"This is a warning message from Loguru\" in caplog.text\n    assert caplog.records[0].levelname == \"INFO\"\n    assert caplog.records[1].levelname == \"WARNING\"","lang":"python","description":"This quickstart demonstrates how to use the `caplog` fixture to capture messages emitted by Loguru. After installing `pytest-loguru`, the `caplog` fixture automatically intercepts Loguru messages, making them available for assertions via `caplog.text` and `caplog.records`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}