O'Reilly logo

Python Testing Beginner's Guide by Daniel Arbuckle

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

Appendix A. Answers to Pop Quizes

Chapter 2

Pop quiz - doctest syntax

  1. Test expression always start with>>>.
  2. Continuation on lines always start with ...
  3. The expected output begins immediately after the expression, and continues until the next blank line.
  4. By using the normalize whitespace directive.
  5. doctest ignores everything between the Traceback (most recent last call).
  6. All of the later code within the same text file can see the variable.
  7. We care because tests are supposed to be isolated from each other, and if two tests use the same variable, they can influence each others' results.
  8. We can represent that section with an ellipsis(...) in the expected output.

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