diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-07-29 01:49:37 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-07-29 01:49:37 (GMT) |
commit | 6a09315ff098224da138ff708e470ebc1c0ba8ac (patch) | |
tree | e21713f5da3e25fa00aaf284c51273d2acde2884 /Doc/library/doctest.rst | |
parent | 10ea19f69c0bdb2c47aaa29c62dcb1f41825a3dc (diff) | |
parent | 1050d2d0c7730c6c533246bb2404937739a7775c (diff) | |
download | cpython-6a09315ff098224da138ff708e470ebc1c0ba8ac.zip cpython-6a09315ff098224da138ff708e470ebc1c0ba8ac.tar.gz cpython-6a09315ff098224da138ff708e470ebc1c0ba8ac.tar.bz2 |
Issue #26462: Merge code block fixes from 3.5
Diffstat (limited to 'Doc/library/doctest.rst')
-rw-r--r-- | Doc/library/doctest.rst | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index c58f417..66a521e 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -88,14 +88,18 @@ Here's a complete but small example module:: doctest.testmod() If you run :file:`example.py` directly from the command line, :mod:`doctest` -works its magic:: +works its magic: + +.. code-block:: shell-session $ python example.py $ There's no output! That's normal, and it means all the examples worked. Pass ``-v`` to the script, and :mod:`doctest` prints a detailed log of what -it's trying, and prints a summary at the end:: +it's trying, and prints a summary at the end: + +.. code-block:: shell-session $ python example.py -v Trying: @@ -109,7 +113,9 @@ it's trying, and prints a summary at the end:: [1, 1, 2, 6, 24, 120] ok -And so on, eventually ending with:: +And so on, eventually ending with: + +.. code-block:: none Trying: factorial(1e100) @@ -196,7 +202,9 @@ file. This can be done with the :func:`testfile` function:: That short script executes and verifies any interactive Python examples contained in the file :file:`example.txt`. The file content is treated as if it were a single giant docstring; the file doesn't need to contain a Python -program! For example, perhaps :file:`example.txt` contains this:: +program! For example, perhaps :file:`example.txt` contains this: + +.. code-block:: none The ``example`` module ====================== |