New submission from Terry J. Reedy <tjre...@udel.edu>:

In the doctest section, 25.2.3.5. 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

http://docs.python.org/py3k/library/doctest.html#option-flags-and-directives

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.

----------
assignee: docs@python
components: Documentation
messages: 161220
nosy: docs@python, eric.araujo, ezio.melotti, georg.brandl, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: #doctest: directives removed from doctest chapter examples
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14865>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to