[Numpy-discussion] nose changes checked in

Alan McIntyre alan.mcintyre@gmail....
Tue Jun 17 22:44:58 CDT 2008

On Tue, Jun 17, 2008 at 8:15 PM, Anne Archibald
<peridot.faceted@gmail.com> wrote:
> Uh, I assumed NumpyTestCase was public and used it. I'm presumably not
> alone, so perhaps a deprecation warning would be good. What
> backward-compatible class should I use? unittest.TestCase?

Yes, unittest.TestCase seemed to be completely adequate for all the
existing tests in NumPy.  Unless you need some functionality
explicitly implemented in NumpyTestCase (like the 'measure' or
'rundocs' methods), you can just replace it with TestCase.   TestCase
can be imported from numpy.testing, although (now that I think about
it) it's probably less cryptic to just import it from unittest.

For module-level doctests, you can place something like this in the module:

from numpy.testing import *
def test():
    return rundocs()

You can replace ParametricTest with generators, as described here:

I will document all this more completely once the test setup isn't
changing on a daily basis, honest.

I'm assuming this experience should tell me that any item "bar" that I
can get by issuing "from numpy.foo import bar" should be considered
the public API and therefore deprecated instead of removed?  ;)


More information about the Numpy-discussion mailing list