[SciPy-dev] Using nose

Alan McIntyre alan.mcintyre at gmail.com
Sat Oct 4 19:22:42 EDT 2008


On Sat, Oct 4, 2008 at 3:07 PM, Anne Archibald
<peridot.faceted at gmail.com> wrote:
> I have a particular pattern of tests I'd like to implement, and I
> don't know a good way to make nose carry it out. The pattern is this:
> I have a class with a setUp function that creates various variables
> (an array of test data, etc.). I also have a handful of test_whatever
> methods. This works fine. But now I'd like to apply exactly the same
> test methods to a different set of data. My first attempt was to
> simply create a derived class which overrode the setUp method, but
> unfortunately neither unittest nor nose will run tests defined in the
> parent class.

Anne,

If I understand correctly, I think you might be able to use a
variation of this technique:

http://projects.scipy.org/scipy/numpy/wiki/TestingGuidelines#creating-many-similar-tests

Please let me know if that doesn't work (or if the doc isn't clear on
something).

Cheers,
Alan



More information about the SciPy-Dev mailing list