We learned the syntax of doctest
, and went through several examples describing how to use it. After that, we took a real-world specification for the AVL tree, and examined how to formalize it as a set of doctests, so that we could use it to automatically check the correctness of an implementation.
Specifically, we covered doctest's default syntax and the directives that alter it, how to write doctests in text files, how to write doctests in Python docstrings, and what it feels like to use doctest
to turn a specification into tests.
Now that we've learned about doctest
, we're ready to talk about how to use doctest
to do unit testing—the topic of the next chapter.
3.139.240.244