[SciPy-dev] WxPython required?

Matthew Brett matthew.brett@gmail....
Sun Jan 20 17:14:23 CST 2008


> > Upon installing wxpython this error disappears, does this mean scipy
> > depends on wxpython now?
>  There are various approaches to
> solve this (different test levels comes to mind, the decorator
> approach to performance tests seen on this list as well).  The default
> test level certainly shouldn't call this test, though.

This prompts me to ask for advice on what to do in this kind of situation.

When I ported the tests to nose, there were a couple of tests that
errored due to failed dependencies, on umfpack, and PIL.   I just
decorated the tests with an import-time check for the dependency, so
they cannot be run without umfpack and PIL respectively, for example

    import PIL.Image
except ImportError:
    _have_PIL = False
    _have_PIL = True
    import scipy.misc.pilutil as pilutil
TestCase.__test__ = _have_PIL

I guess the options are:

Completely disable tests with absent optional dependencies (as above)

Add such tests at the 'full' testing level with a decorator specific
for optional dependencies, like @optdeps

Don't run these tests with standard test levels, just allow them to be run with:
>>> module.test('optdeps') or nosetests -A optdeps /path/to/module

Preferences anyone?


More information about the Scipy-dev mailing list