O'Reilly logo

Django 1.1 Testing and Debugging by Karen M. Tracey

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

Revisiting the doctest caveats

In the previous chapter, we developed a list of things to watch out for when writing doctests. When discussing these, unit tests were sometimes mentioned as an alternative that did not suffer from the same problems. But are unit tests really immune to these problems, or do they just make the problems easier to avoid or address? In this section, we revisit the doctest caveats and consider how susceptible unit tests are to the same or similar issues.

Environmental dependence

The first doctest caveat discussed was environmental dependence: relying on the implementation details of code other than the code actually being tested. Though this type of dependence can happen with unit tests, it is less likely to occur. This ...

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