zope.testing.doctest can't handle non-ascii output

Bug #144569 reported by Barry Warsaw on 2007-09-24
4
Affects Status Importance Assigned to Milestone
zope.testing
Undecided
Unassigned

Bug Description

Zope's doctest.py can't handle non-ascii in doctest files. A simple fix to DocTestRunner.__init__() will make 'print' in doctests simulate printing to a utf-8 compatible terminal, thus allowing non-ascii in output and and doctest files.

See related bug #69988 for a patch.

Barry Warsaw wrote:
> Zope's doctest.py can't handle non-ascii in doctest files.

I /thought/ zope.testing.doctest was given support for encoding
sniffing. Either way any time invested in this would likely be better
invested in reconsiling zope.testing.doctest and Python's doctest.py.
--
Benji York
Senior Software Engineer
Zope Corporation

Barry Warsaw (barry) wrote :

Is there a list of what these differences are? Is there any information on what's special about Zope's doctest that the Zope tests rely on?

Barry Warsaw wrote:
> Is there a list of what these differences are? Is there any information
> on what's special about Zope's doctest that the Zope tests rely on?

Not really. I've taken a stab at reconciling the two with only diffs
and check-in messages to go on, but eventually ran out of steam when I
got a version that would pass doctest.py's internal tests, but wouldn't
pass Python's doctest tests.

The only real added feature in zope.testing's doctest I can think of is
the reST footnote support. The remainder, IIRC, are bug fixes of one
flavor or another.

Jim Fulton (jim-zope) wrote :

On Sep 24, 2007, at 5:30 PM, Benji York wrote:

> Barry Warsaw wrote:
>> Is there a list of what these differences are? Is there any
>> information
>> on what's special about Zope's doctest that the Zope tests rely on?
>
> Not really. I've taken a stab at reconciling the two with only diffs
> and check-in messages to go on, but eventually ran out of steam when I
> got a version that would pass doctest.py's internal tests, but
> wouldn't
> pass Python's doctest tests.
>
> The only real added feature in zope.testing's doctest I can think
> of is
> the reST footnote support. The remainder, IIRC, are bug fixes of one
> flavor or another.

There are enhancements to the test metrics that we'd like to
differently someday.

There may be better pdb support. I'mm not sure.

Jim

--
Jim Fulton
Zope Corporation

Tres Seaver (tseaver) wrote :

I have just added a test which shows unicode (non-ASCII) rendering cleanly in the trunk:

  http://svn.zope.org/zope.testing/trunk/?rev=110640&view=rev

affects: zope3 → zopetoolkit-project
Changed in zopetoolkit-project:
status: New → Invalid
status: Invalid → Incomplete
Tres Seaver (tseaver) on 2010-04-14
affects: zopetoolkit-project → zope.testing
Adam Groszer (agroszer) wrote :

Feels like a duplicate of https://bugs.launchpad.net/bugs/69988

tags: added: bugday20100424
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers