On Mon, Dec 21, 2009 at 10:27:01PM +0100, Lennart Regebro wrote:
> I added the imports back, and also some deprecation warnings, although
> I'm not sure how to best add them,

Maybe zope.deprecation can help?

> so I just stuck them in the
> modules, so the first import will raise a warning. A new release would
> be great, I guess. Christian, what do you say?

The warning in zope.testing.doctestunit says "zope.testing.doctest is
deprecated", I think it should say "doctestunit".  I fixed that in svn
(and added stacklevel=2, so you can see where in your code those modules
are imported).

Should zope.testing.doctestunit.pprint be deprecated?

It's trying to fix a misfeature of stdlib's pprint.pprint, which is that
pprinting a dict will output its repr() if len(repr(a_dict)) is narrower
than the desired wrapping width.  The order of keys and values of a
dict's repr() is not well-defined, which tends to cause issues for
doctests.  zope.testing.doctestunit.pprint works around it by hardcoding
the wrapping width to 1, which results in somewhat ugly output, but
forces the stdlib's pretty-printer to sort dict keys alphabetically.

I don't have strong feelings one way or another.  I have 18 test files
that use zope.testing.doctestunit.pprint, but since I always found its
output ugly, I wouldn't mind writing some custom dict printing

Marius Gedminas
http://pov.lt/ -- Zope 3 consulting and development

Attachment: signature.asc
Description: Digital signature

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to