[SciPy-dev] scipy testing changes revisited

Pearu Peterson pearu at cens.ioc.ee
Wed Jan 5 04:29:34 CST 2005

On 22 Dec 2004, Todd Miller wrote:

> A week or so ago we were discussing the set of changes to scipy's
> testing framework needed to add support for numarray.   The changes I'm
> talking about here should be made to the main trunk of scipy CVS.
> After further review,  I now think the array versions of the assert
> family of functions (e.g. assert_array_equal) are correct with respect
> to truth value testing.  So, the only change I think is needed is the
> addition of "delegation code" so that calls to assert_equal, etc. defer
> to assert_array_equal, etc. when passed array parameters.   Here's the
> patch:

I have applied the patch with an addition of calling array versions
of assert_* functions whenever either of arguments is an array.

> These changes are necessary for adding numarray support to scipy because
> without them there are 12 testing failures (in scipy_base.test()).  The
> failures are all related to numarray's "outlawed" __nonzero__() and
> testers apparently calling the wrong assertion function.  With these
> changes,  7 of the numarray failures go away and 5 identical failures
> remain for both numarray and Numeric.  I'm arguing that the 5 remaining
> failures are either real problems or testing bugs which were masked by
> testers calling the wrong assert functions and by Numeric's sometrue()
> definition of __nonzero__(). 

I agree. These 5 failures are now fixed in the main trunk.

> In each case you can see that assert_array_equal has been called from
> the new delegation code in assert_equal. 
> At this point,  I guess I have two questions:
> 1. Is this patch acceptable for the main trunk now?

Looks ok to me. The patch is applied.

> 2. If so, who should fix the test failures?

Anyone is welcome to fix the failures. The failures should be now fixed.


More information about the Scipy-dev mailing list