[SciPy-dev] Making numpy test work in scikits

David Cournapeau david@ar.media.kyoto-u.ac...
Sat Jul 21 00:47:45 CDT 2007

Stefan van der Walt wrote:
> On Fri, Jul 20, 2007 at 09:23:11PM +0900, David Cournapeau wrote:
>> def test_suite(*args):
>>     return NumpyTest().test(level = -1)
>> Then while executing the tests with setuptools, I have some infinite 
>> recursion (which is due to the fact that NumpyTest is importing the 
>> current package I guess ?). I am kind of stuck, and I feel like I 
>> already wasted way too much time on this.
> What happens if you specify the name of the module you wish to test,
> i.e.
> def test_suite(*args):
>     return NumpyTest("mymodule").test(level=-1)
Ok, I managed to make it work by doing the following:

def test_suite(*args):
    # XXX: this is to avoid recursive call to itself. This is an 
horrible hack,         
    # I have no idea why infinite recursion happens 
    if len(args) > 
        import unittest
    return NumpyTest().test(level = -10) 

Now, I have to understand why it does not work when I give the all=True 
argument to NumpyTest().test. I am starting to think it would be much 
easier to build test suite by hand for each test script...


More information about the Scipy-dev mailing list