Tres Seaver wrote:
I see a couple of problem points:  the
biggest is the use in the output of 'checkSiteManager.html' of a repr'ed
dict, which might render differently between different machines (or even
the same machine across Python versions).  This is a classic case where
the "doctest" does *not* provide clarity over a "traditional" 'unittest'
style test, IMNSHO.

It is often clearer to show the contents of a dict than making an assertion.
In those cases where it's not, you can make a unittest style assertion, as in:

>>> thisdict == thatdict

This is really just a matter of knowing how to write the test.
Generally, when you want to show a dict sample, the way to do it
is with:

>>> from zope.testing/doctestunit import pprint
>>> pprint(thisdict)

This formats the dictionary nicely and, most importantly,
sorts the items before displaying it.


Jim Fulton           mailto:[EMAIL PROTECTED]       Python Powered!
CTO                  (540) 361-1714  
Zope Corporation
Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to