summaryrefslogtreecommitdiff
path: root/Doc/library/doctest.rst
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-07-26 11:18:21 +0200
committerMartin Panter <vadmium+py@gmail.com>2016-07-26 11:18:21 +0200
commit75fac880fc7f79951dc9c28b4997f8e7069bf07a (patch)
tree9e7ef8cd7cef9938735baadd71eb496d641649bf /Doc/library/doctest.rst
parent83224228ea950cfea1d7abfc0173c29a9ba49fb0 (diff)
downloadcpython-75fac880fc7f79951dc9c28b4997f8e7069bf07a.tar.gz
Issue #26462: Doc: reduce literal_block warnings, fix syntax highlighting.
Patch by Julien Palard.
Diffstat (limited to 'Doc/library/doctest.rst')
-rw-r--r--Doc/library/doctest.rst16
1 files changed, 12 insertions, 4 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index c58f417c31..66a521ebe7 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
======================