picologging icon indicating copy to clipboard operation
picologging copied to clipboard

Make a pytest fixture for log capture

Open pamelafox opened this issue 2 years ago • 1 comments

To enable easier testing in pytest, it'd be useful if we supported a fixture similar to caplog.

https://github.com/pytest-dev/pytest/blob/63d2f7f7f8ec8b09c4289f18a94178c520d93bff/src/_pytest/logging.py#L491

We can register the hook in setup.py to avoid creating a whole separate package.

cc @Goldziher for the suggestion.

pamelafox avatar Oct 19 '22 20:10 pamelafox