[Numpy-discussion] Test framework changes

Robert Kern robert.kern@gmail....
Fri Jun 20 16:35:19 CDT 2008


On Fri, Jun 20, 2008 at 16:01, Alan McIntyre <alan.mcintyre@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