Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 4fbc0d8baa2126db4ace0c8a03c1773f01abdda6 authored by Georg Brandl on 13 November 2010, 13:25:40 UTC
Minor edits.
Tip revision: 4fbc0d8
test_doctest.txt
This is a sample doctest in a text file.

In this example, we'll rely on a global variable being set for us
already:

  >>> favorite_color
  'blue'

We can make this fail by disabling the blank-line feature.

  >>> if 1:
  ...    print('a')
  ...    print()
  ...    print('b')
  a
  <BLANKLINE>
  b
back to top