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

Bug #144569 reported by Barry Warsaw
4
Affects Status Importance Assigned to Milestone
zope.testing
Invalid
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.

Revision history for this message
Benji York (benji) wrote : Re: [Bug 144569] zope.testing.doctest can't handle non-ascii output

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

Revision history for this message
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?

Revision history for this message
Benji York (benji) wrote : Re: [Bug 144569] Re: zope.testing.doctest can't handle non-ascii output

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.

Revision history for this message
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

Revision history for this message
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)
affects: zopetoolkit-project → zope.testing
Revision history for this message
Adam Groszer (agroszer) wrote :

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

tags: added: bugday20100424
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.testing project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.testing.

Changed in zope.testing:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.