5 Advanced Pytest Tricks

We write tests because they help us build confidence in our code. They also help us write clean and maintainable code. Yet, writing tests requires some effort. Fortunately, there are libraries we can leverage. Pytest, for example, comes with a lot of handy features that are often not used. In this article, I will introduce you to 5 of them. Test logging with caplog fixture Sometimes, logging is part of your function and you want to make sure the correct message is logged with the expected logging level. [Read More]