[SciPy-dev] Making numpy test work in scikits

Matthieu Brucher matthieu.brucher@gmail....
Mon Jul 23 02:47:57 CDT 2007


>
> 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
> otherwise.
>     if len(args) >
> 0:
>         import unittest
>         return
> unittest.TestSuite()
>     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...


I just tried to use this for openopt scikit, and strangely the first time it
didn't work with testall(), the second time, it worked...
I found something strange though (latest svn). When the level is positive,
the tests are found and run, but when the level is negative, the files are
found, but not the tests (it indicates Found 0 tests for ....py). Is that
correct ? I thought the same number of tests should have been found.
What is more, if specific data is needed for the test (and is in the same
folder), you have to specify the full path in your test file because the
current path is set to the folder where the test suite is run, not where the
current test is placed. It's not due to Numpy, I know, but it adds a burden
:|

Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-dev/attachments/20070723/b649b25b/attachment.html 


More information about the Scipy-dev mailing list