[Numpy-discussion] Test fails for rev. 2473

Tim Hochberg tim.hochberg at cox.net
Wed May 3 09:20:05 EDT 2006


Albert Strasheim wrote:

>Hello all
>
>  
>
>>-----Original Message-----
>>From: numpy-discussion-admin at lists.sourceforge.net [mailto:numpy-
>>discussion-admin at lists.sourceforge.net] On Behalf Of Sasha
>>Sent: 03 May 2006 17:49
>>To: Johannes Loehnert
>>Cc: numpy-discussion at lists.sourceforge.net
>>Subject: Re: [Numpy-discussion] Test fails for rev. 2473
>>
>>On 5/3/06, Johannes Loehnert <a.u.r.e.l.i.a.n at gmx.net> wrote:
>>
>>    
>>
>>>[snip]
>>>"/scratch/jloehnert/python-svn/lib/python2.3/site-
>>>      
>>>
>>packages/numpy/testing/numpytest.py",
>>    
>>
>>>line 185, in rundocs
>>>    tests = doctest.DocTestFinder().find(m)
>>>AttributeError: 'module' object has no attribute 'DocTestFinder'
>>>      
>>>
>>It looks like this test expects python 2.4 version of doctest.  If we
>>are going to support 2.3, this is a bug.
>>    
>>
>
>Are doctests really worth it? They are reasonably useful when developing new
>code, but "normal" tests might be better once the code is done. I also found
>out that they break trace.py, a very useful tool included with Python for
>determining code coverage -- knowledge that would be very useful for
>identifying areas where NumPy's test suite can be improved.
> 
>I prepared two patches to turn the existing doctests into "normal" tests:
>
>http://projects.scipy.org/scipy/numpy/ticket/87
>http://projects.scipy.org/scipy/numpy/ticket/88
>
>  
>
In general, I'm not a big fan of turning doctests into "normal" tests. 
Any time you muck with a working test you have to worry about 
introducing bugs into the test suite. In addition doctests are 
frequently, although certainly not always. clearer than their unit test 
counterparts. It seems that the time would be better spent fixing trace 
to do the right thing in the presence of doctests. Then again, you've 
already spent the time so it's to late to unspend it I suppose.

-tim







More information about the NumPy-Discussion mailing list