[SciPy-dev] WxPython required?

Matthew Brett matthew.brett at gmail.com
Mon Jan 21 05:12:15 EST 2008


Hi,

> > I'm happy to try to import PIL and have nose skip the tests if PIL is not found;
> > however, this approach cannot be safely extended to wx. You might want to raise
> > SkipTest instead of assigning TestCase.__test__=False, though. That tells the
> > user that a test is being skipped and gives them a command line option to force
> > nosetests to run the test anyways.

Thanks - SkipTest does seem like the right thing to do.

> I was wondering if for things like GUI tests, we could use nosepipe:
>
> http://pypi.python.org/pypi/nosepipe/

Good pointer.  The rule of thumb being that any test that imported wx
or other GUI thing would use nosepipe, and nosetests vanilla
otherwise.  Things may start to get a bit complex though.  First we've
got the extra dependency on nosepipe - minor.  Then we've got the
question of whether we want to run all tests for one module through
nosepipe if only one test has GUI code - there's only one nosetests
call per module.  The alternative, would be to decorate tests destined
for nosepipe, and have two test calls, one for the nosepipe tests, and
one for the non-nosepipe tests, as in:

module.test()
...

def test():
    nose.run(argv = ['', directory_name, '-A', 'not needpipe'])
    nose.run(argv = ['', directory_name, '-A', 'needpipe',
'--with-process-isolation'])

This moves us further away from the simple

nosetests /my/scipy/directory

from the command line, but...

So - more functionality, less simplicity and transparency - the usual thing.

Matthew



More information about the SciPy-Dev mailing list