[SciPy-dev] Nose tests - merged

Matthew Brett matthew.brett@gmail....
Sat Jan 12 12:18:33 CST 2008

Hi Nathan,

> I like the separation of benchmarks and unittests.  I'll update my
> sparse benchmarks accordingly.

Ah - well - there's the first glitch.  I see you very sensibly read
the README file, which says:

Benchmark tests

Routines that don't actually test correctness but instead do performance
benchmarking will live in a benchmarks/ directory next to the tests/ directory
of each module.  There will be a scipy.benchmark() call that does benchmarking,
similar to scipy.test() but separate from it.

Now, I didn't do this because it would have added an extra layer of
nose complexity.as well as requiring some boilerplate in the module
init to implement. What I did do was add a test decorator specific for
benchmarks.  So,


do not run tests with a label of 'bench'


test('bench') does.

Tests can be labeled thus:

def test_algorithm_speed():

For me, the way it works now seems to cover the need for something
obviously benchmarking without adding a extra layer on top of the
testing and code layout.  But, we could also go the other way.  I'd be
happy of group thoughts.


More information about the Scipy-dev mailing list