[Zope3-dev] PyCon doctest talk

Jim Fulton jim at zope.com
Thu Apr 1 10:02:59 EST 2004


Stephan Richter wrote:
> On Wednesday 31 March 2004 10:13, Jim Fulton wrote:
> 
>>I promised I'd make my talk available:
>>
>>   http://www.python.org/pycon/dc2004/papers/4/PyCon2004DocTestUnit/
> 
> 
> Jim,
> 
> I just read through the slides and noticed that I already started a feature 
> that you might be interested in. I have written a little pprint function in 
> zope.app.apidoc.tests, which takes a data structure, converts all 
> dictionaries in it to a sorted list of 2-tuples and then returns the result 
> using the pprint module. The max width of the output is 69, so that the 
> output will always fit in a doc string.

69 characters won't always fit.  It depends on the indentatioon used.

> Of course, much could be improved, for example also converting class instances 
> to a better comparable form or allow to specify the width dynamically, but I 
> think this is a start. It made testing the many methods of view classes much 
> simpler.

Yup.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list