Raniz’ Blog | The art of testing: failing gracefully

In this post, Raniz talks about Python tests and how and why to write them in a way that it’s easy to find the issue when a test fails.

When using unittest, it’s better to test each attribute of a result separately to make the test output more on point. The downside is that if there are multiple bugs, the later ones only surface when previous ones have been solved.

With pytest, the framework automatically drills down and shows only the values that differ.