Skip to content

Conversation

etianen
Copy link
Contributor

@etianen etianen commented Feb 13, 2024

I've just released logot, a log testing library that includes a pytest plugin. Although it works with other testing frameworks, the pytest integration is showcased everywhere in the docs, and generally expected to be the way to use it.

Because the library is not named pytest-XXX, it needs to be added to the manual plugin list. 🙇

Here's a quick example of how it looks:

from logot import Logot, logged

def test_something(logot: Logot) -> None:
   do_something()
   logot.assert_logged(logged.info("Something was done"))

logot's most interesting feature is its ability to test highly-concurrent threaded or async code by asserting on captured logs. It's also useful in "normal" synchronous code as a higher-level caplog replacement.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@nicoddemus nicoddemus merged commit fe7907d into pytest-dev:main Feb 14, 2024
@etianen etianen deleted the add-logot-docs branch February 14, 2024 19:08
flying-sheep pushed a commit to flying-sheep/pytest that referenced this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants