How to Add Loguru Support to Pytest in Python

preview_player
Показать описание
In this pytest tutorial, you will learn how to loguru support to pytest.

First, we will see how to test log messages using pytest's caplog fixture.

Secondly, we implement the same application using loguru as logging library.

Lastly, a custom pytest fixture is implemented overwriting the built-in caplog fixture and adding support for loguru.

GitHub Repository

SUBSCRIBE to become a Pythonista!

Follow me on Twitter!

Check out my website for more!

Like what you see? Consider sponsoring me via Patreon!

~~~~~~~~~~ OUTLINE ~~~~~~~~~~
00:00 Introduction
00:39 Project setup
01:31 Test built-in logging module
08:07 Test loguru library
11:07 Overwrite caplog fixture

#python #pytest #testing
Рекомендации по теме
Комментарии
Автор

Thank you very much Florian 👍 it will be great if you make more videos on pytest.

mehdicherifi
Автор

Great content Florian! There is no good pytest course on the internet.

t_geek
Автор

from _pytest.logging import caplog as _caplog isn't works for some reason, when a set _caplog as a parameter to caplog fuction it is gray

SweetLemonadeYT
welcome to shbcf.ru