Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/etianen/logot
Test whether your code is logging correctly 🪵
https://github.com/etianen/logot
logging pytest-plugin python testing
Last synced: 6 days ago
JSON representation
Test whether your code is logging correctly 🪵
- Host: GitHub
- URL: https://github.com/etianen/logot
- Owner: etianen
- License: mit
- Created: 2024-01-14T16:34:03.000Z (almost 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-22T10:21:15.000Z (9 months ago)
- Last Synced: 2024-04-22T11:34:10.672Z (9 months ago)
- Topics: logging, pytest-plugin, python, testing
- Language: Python
- Homepage: https://logot.readthedocs.io
- Size: 344 KB
- Stars: 89
- Watchers: 3
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-python-testing - logot - Test whether your code is logging correctly. (Tools)
README
# Log-based testing 🪵
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![Build](https://github.com/etianen/logot/actions/workflows/build.yml/badge.svg)](https://github.com/etianen/logot/actions/workflows/build.yml)
[![Codecov](https://codecov.io/gh/etianen/logot/graph/badge.svg?token=J5K0LOOSTZ)](https://codecov.io/gh/etianen/logot)
[![Docs](https://readthedocs.org/projects/logot/badge/)](https://logot.readthedocs.io)
[![PyPI version](https://img.shields.io/pypi/v/logot.svg)](https://pypi.org/project/logot/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/logot.svg)](https://pypi.org/project/logot/)`logot` makes it easy to test whether your code is logging correctly:
```python
from logot import Logot, loggeddef test_something(logot: Logot) -> None:
do_something()
logot.assert_logged(logged.info("Something was done"))
````logot` integrates with popular testing frameworks (e.g. [`pytest`](https://logot.readthedocs.io/latest/using-pytest.html), [`unittest`](https://logot.readthedocs.io/latest/using-unittest.html)). It supports many 3rd-party [asynchronous](https://logot.readthedocs.io/latest/integrations/index.html#asynchronous-frameworks) and [logging](https://logot.readthedocs.io/latest/integrations/index.html#logging-frameworks) frameworks, and can be extended to support many more. 💪
## Documentation 📖
Full documentation is published on [Read the Docs](https://logot.readthedocs.io). Learn more about `logot` with the following guides:
- [Log message matching](https://logot.readthedocs.io/latest/log-message-matching.html)
- [Log pattern matching](https://logot.readthedocs.io/latest/log-pattern-matching.html)
- [Log capturing](https://logot.readthedocs.io/latest/log-capturing.html)
- [Using with `pytest`](https://logot.readthedocs.io/latest/using-pytest.html)
- [Using with `unittest`](https://logot.readthedocs.io/latest/using-unittest.html)
- [Installing](https://logot.readthedocs.io/latest/installing.html)## Bugs / feedback 🐛
Issue tracking is hosted on [GitHub](https://github.com/etianen/logot/issues).
## Changelog 🏗️
Release notes are published on [GitHub](https://github.com/etianen/logot/releases).
## License ⚖️
`logot` is published as open-source software under the [MIT license](https://github.com/etianen/logot/blob/main/LICENSE).