PEP: Procedure for Adding New Modules (please comment)

Paul Winkler slinkp23 at yahoo.com
Tue Jul 10 11:34:52 EDT 2001


Tim Peters wrote:
> 
> [Paul Winkler]
> > ...
> > I also should not have implied that the existing library is not
> > adequately tested; I have no basis for thinking that.
> 
> But I do:  it's not.

OK, then I reinstate my rescinded remark. :)

> This is an area where community contributions are almost non-existent.  If
> anyone is looking for a low-commitment way to help Python out, pick your
> favorite library module and contribute some good tests for it!  There's a
> decent orientation Lib/test/REAMDE to help you get started.  The regrtest.py
> framework is baroque and inadequately documented, but it can run both
> unittest- and doctest-based tests in natural ways now.

This sounds like a good idea. In fact I think I'll do that. Should we work from
CVS, or is Python 2.1 OK?

(snip)
> IOW, every example posted to every mailing list, along with every example in
> PEP 255, was simply *pasted* into a test string.  It was no additional work

Hmm, this sounds pretty cool actually. I'm liking doctest more and more. It
appeals to the lazy programmer in me.

> to speak of; WYSIWYG; nothing was written *just* "to test"; and if you can
> read straight Python, you can easily and directly see what each little piece
> is testing.  WRT the latter, what do you think the earlier
> 
>         self.assertRaises(TypeError, list, list)
> 
> was testing?  I wrote it, but I couldn't remember after I copied the code
> into this msg; I had to look up the source for unittest's assertRaises().
> As a doctest, it would have read
> 
> """
> >>> list(list)
> Traceback (most recent call last):
>   ...
> TypeError: iter() of non-sequence
> """
> 
> instead and then "it's obvious".

I did do a double-take on the assertRaises() version, but in the context of the
surrounding tests that's pretty much what I guessed it would mean.
But yes, list(list) is a bit more obvious.
 
(snip)
> All new Python tests should be in unittest or doctest format; and we'd
> gladly adopt conversions of existing tests to those formats too (all the
> PythonLab'ers have converted some of them, but there's too much else that
> needs doing too to expect us to finish all of them without help).
> 
> well-actually-you're-free-to-expect-anything-ly y'rs  - tim

Well then, I hereby expect you to rename the _ variable in Zope into something
meaningful. And bobobase_modification_time while you're at it. :P

zope-is-great-except-python-expressions-in-dtml-which-are-weirder-than-perl-ly
y'rs  - 

Paul

-- 
...................    paul winkler   ....................
custom calendars & printing: http://www.calendargalaxy.com
       A member of ARMS:   http://www.reacharms.com
            home page:  http://www.slinkp.com



More information about the Python-list mailing list