O'Reilly logo

Test-Driven Python Development by Siddharta Govindaraj

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making tests readable

In the previous section, we looked at the rather mundane issue of file layout and naming conventions. We are now going to take a look at the ways we can improve the test cases themselves.

Our first goal is to make it easier to understand the tests themselves. There is nothing worse than locating a test case and then having a hard time figuring out what the test is trying to do.

I'm sure I will not be the first to confess that there have been multiple occasions where I have returned to a test that I myself wrote a year back, and struggled to understand what I was trying to do.

This is an area that is often ignored because when we write the test, it seems perfectly obvious what the test does. We will need to put ourselves in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required