[SciPy-dev] WxPython required?

Matthew Brett matthew.brett at gmail.com
Sun Jan 20 18:14:23 EST 2008


Hi,

> > 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
misc/tests/test_pilutil.py

try:
    import PIL.Image
except ImportError:
    _have_PIL = False
else:
    _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?

Matthew



More information about the SciPy-Dev mailing list