Writing a testable novel with doctest

Running a series of story tests showcases your code's expected behavior. We have previously seen in the Writing a testable story with doctest recipe how to build a testable story and have it generate a useful report.

With this recipe, we will see how to use this tactic to string together multiple testable stories to form a testable novel.

Getting ready

For this recipe, we will be using the shopping cart application shown at the beginning of this chapter.

We will also re-use the BddDocTestRunner defined in this chapter's Writing a testable story with doctest recipe. But we will slightly alter it in the following steps.

How to do it...

With the following steps,we will look at how to write a testable novel:

  1. Create a ...

Get Python Testing Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.