Separation of tests into unit test and functional tests

Stéfan van der Walt stefan at sun.ac.za
Tue Oct 20 01:11:37 EDT 2009


2009/10/19 Ralf Gommers <ralf.gommers at googlemail.com>:
> The main thing I think is to be careful with images. The slowest one by far
> now are the tests for lpi_filter, because they do a lot of things with a
> *large* image.

Also, the kernel size is currently set to the shape of the image,
which is not necessary.  I'd also like the filtering code to take a
kernel as a parameter, instead of a function.  I've placed it on the
tasks list.

> This is why I originally put my test images for io under io/tests. I thought
> data_dir should only contain images for examples, useful for users. Images
> for testing algorithms can often be small. For the color conversion I now
> use images of size (4, 2, 3), which means they take no time at all.

The idea is for each package to use the same pool of images, so that
we don't have to include data-files in each sub-package.  If needed,
we could put them in subdirectories under data to show what they were
intended for.

> What is lacking when you apply decorators like @opencv_skip and @slow? Note
> also that if you run nosetests from some folder you run only tests in
> subfolders. This is a natural separation already.

I see one danger in using @slow: people stop executing anything but
the fast tests.  In such a case, it may simply be worth speeding up
the slow test, if possible.

Ralf gives a good tip for developing: run only the relevant tests, e.g.,

nosetests scikits.image.opencv

Cheers
Stéfan



More information about the scikit-image mailing list