Expecting blank lines

The doctest uses the first blank line after >>> to identify the end of the expected output, so what do you do when the expected output actually contains a blank line?

The doctest handles this situation by matching a line that contains only the text <BLANKLINE> in the expected output with a real blank line in the actual output.

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

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