[New-bugs-announce] [issue3020] doctest should have lib2to3 integration

Stefan Behnel report at bugs.python.org
Sun Jun 1 16:37:28 CEST 2008

New submission from Stefan Behnel <scoder at users.sourceforge.net>:

Running a doctest with Py2 syntax in Py3 currently involves either
running the 2to3 tool by hand or writing code to convert the doctest
using lib2to3, and then running the modified version. This basically
pushes the burden of automating this step in any test runner script in
the world onto the authors or users of these scripts.

Writing portable code is hard enough, but writing portable doctests that
remain user readable should not remain as hard as it currently is. The
doctest module in Py3 should have a simple option to run a Py2 doctest
(in a file or doc string) without requiring users to write the glue code
for it.

On a related note, if a 3to2 tool becomes available, this should be
directly supported by doctest in Py2.6.

assignee: collinwinter
components: 2to3 (2.x to 3.0 conversion tool), Library (Lib)
messages: 67594
nosy: collinwinter, scoder
severity: normal
status: open
title: doctest should have lib2to3 integration
type: feature request
versions: Python 3.0

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list