Skip to content

Enable live logging via fixture #9269

Answered by twmr
phausamann asked this question in Q&A
Nov 5, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

First of all, such a cli-logging fixture would be a great addition to the pytest logging plugin.

I think it is possible to replicate the behavior of the log-cli feature in a
pytest fixture, but integrating it in a proper way into pytest might turn
out to be complicated.

All you need is the catching_logs ctx manager and the log_cli_level and the log_cli_handler.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@twmr
Comment options

@phausamann
Comment options

Answer selected by phausamann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants