[Numpy-discussion] More pending test framework changes (please give feedback)

Charles R Harris charlesr.harris at gmail.com
Tue Jul 1 14:37:07 EDT 2008


On Tue, Jul 1, 2008 at 9:26 AM, Alan McIntyre <alan.mcintyre at gmail.com>
wrote:

> On Mon, Jun 30, 2008 at 1:54 PM, Alan McIntyre <alan.mcintyre at gmail.com>
> wrote:
> > 1. All doctests in NumPy will have the numpy module available in their
> > execution context as "np".
> >
> > 2. Turn on the normalized whitespace option for all doctests.  Having
> > a doctest fail just because there's a space after your result seems
> > like an unnecessary hassle for documenters.
> >
> > 3. Output will be ignored for each doctest expected output line that
> > contains "#random". I figured this can serve both as an ignore flag
> > and indication to the reader that the listed output may differ from
> > what they see if they execute the associated command. So you would be
> > able to do:
> >>>> random.random()
> > 0.1234567890                           #random: output may differ on your
> system
> >
> > And have the example executed but not cause a failure.  You could also
> > use this to ignore the <SomeObject at 0x1234ABCD> output from plot
> > methods as well.
>
> Since I didn't see any objections, these changes are now committed.
> I'll be updating some doctests to take advantage of them later today.
>

I note that a lot of unit test files import tons of specific functions,
numpy.core, etc., etc. Is there any reason not to fix things up to

import numpy as np
from numpy.testing import *

I fixed one file this way, but I wonder if we shouldn't make all of them
work like that.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080701/19cacb8c/attachment.html>


More information about the NumPy-Discussion mailing list