[Numpy-discussion] Test framework changes

Robert Kern robert.kern at gmail.com
Fri Jun 20 17:35:19 EDT 2008


On Fri, Jun 20, 2008 at 16:01, Alan McIntyre <alan.mcintyre at gmail.com> wrote:

> - numpy.test now returns an object with a wasSuccessful method; under
> the old test framework it returned a unittest._TextTestResult, but
> since nose.run only returns success/failure, I'm just wrapping this
> result in a dummy object to match the old behavior until I can figure
> out how to get a real _TextTestResult from nose.

So NoseTester.run() basically just calls nose.run(). That basically
just instantiates nose.core.TestProgram and returns the .success
attribute of it. Unfortunately, the TextTestResults object (a nose
subclass of unittest._TextTestResults) gets created and discarded
inside the nose.core.TestProgram.runTests() method. However, if you
were to subclass it and override that method to store the
TextTestResults to an attribute, you could return it from
NoseTester.run().

-- 
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