[Numpy-discussion] [SciPy-dev] Doc-day

Robert Kern robert.kern@gmail....
Fri Dec 28 13:55:33 CST 2007


Matthieu Brucher wrote:
>     Matthew B. will be working on converting SciPy tests to use nose per
>     Fernando's email.  If you are familiar with nose and want to help,
>     please make sure to check with Matthew or Fernando first.
> 
> 
> I must have missed Fernando's email because I can't find the references
> for nose :(

Look in "SciPy Sprint Results". It's only a brief mention, though.

> What are its advantages against the current numpy.testing framework ?

Primarily:

* It is supported by someone else and gaining wide adoption by the rest of the
Python community.

Secondarily:

* More flexible organization of tests. For nose, if it looks like a test, it's a
test. numpy.testing collects test modules which are named like the module it is
testing. E.g. for module.py <=> tests/test_module.py.

* Test generators:

  def test_evens():
    for i in range(0, 5):
      yield check_even, i, i*3

  def check_even(n, nn):
    assert n % 2 == 0 or nn % 2 == 0

* Package- and module-level setup() and teardown() functions.

* Test functions can be simple functions. They do not need to be organized into
classes if you don't need classes.

* Integrated doctest collection.

* Detailed error/failure reporting. nose can print out the values of variables
at the location of the error.

* Integrated code coverage and profiling.

* Dropping into pdb on errors and failures.

* More flexible running of specific tests. E.g. when I'm working on getting a
particular test function running, I can specify that exact test and not run the
rest of the test suite.

* Output capture. Tests can print out anything they like to be more informative,
but they won't appear unless if the test fails.

More thoroughly:

  http://somethingaboutorange.com/mrl/projects/nose/

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the Numpy-discussion mailing list