Re: zope.testing.doctestunit and BBB

Marius Gedminas <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <20091222092616.GA7855@platonas>
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
functions.

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

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFLMJCzkVdEXeem148RAmnOAJ45nxFiE6eGHCvVgjUv2ZiTRomh1QCeMhOZ
HRqzbjHKjteAUsy9WSQYpm4=
=pnt3
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.