a blog by Marius Gedminas

Posts tagged Python

On narrative doctests

Andrew Bennetts writes why narrative tests are lousy unit tests. I completely agree. Narratives are great as documentation, and the embedded doctest sections help (1) keep the documentation up-to-date and (2) provide concrete examples that make the documentation easier to understand. Here's a good example of that: Storm ORM tutorial. But for unit tests you want many small, isolated tests rather than one big narrative, for reasons that Andrew so clearly elucidated in his post.