Author terry.reedy
Recipients docs@python, eric.araujo, ezio.melotti, georg.brandl, terry.reedy
Date 2012-05-20.17:58:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In the doctest section, Option Flags and Directives has examples of using #doctest: directives in the .rst source
An example's doctest directives modify doctest's behavior for that single example.  Use ``+`` to enable the named behavior, or ``-`` to disable it.

For example, this test passes::

   >>> print(list(range(20))) #doctest: +NORMALIZE_WHITESPACE
   [0,   1,  2,  3,  4,  5,  6,  7,  8,  9,
   10,  11, 12, 13, 14, 15, 16, 17, 18, 19]
However, when converted to html or Window's help, the directive is removed. See for example

This was reported on python-list for 2.7 and 3.? (.2 probably) by Steven D'Aprano and verified by me for 3.3.0 Win help. Vincent Vande Vyvre provided quote from 3.? .rst source and I verified it and several more following in 3.3.0.

I presume the problem is that we now use the same directives to help doctest source examples for other modules and sphinx with our customizations does not know to leave these particular directives in the text after using them.

I searched issues for '#doctest' and did not see anything about removal.
Date User Action Args
2012-05-20 17:58:14terry.reedysetrecipients: + terry.reedy, georg.brandl, ezio.melotti, eric.araujo, docs@python
2012-05-20 17:58:14terry.reedysetmessageid: <>
2012-05-20 17:58:13terry.reedylinkissue14865 messages
2012-05-20 17:58:13terry.reedycreate