[Numpy-discussion] ANN: NumPy 1.2.0

Charles R Harris charlesr.harris@gmail....
Mon Sep 29 12:40:26 CDT 2008


On Mon, Sep 29, 2008 at 11:35 AM, Robert Kern <robert.kern@gmail.com> wrote:

> On Mon, Sep 29, 2008 at 12:30, Charles R Harris
> <charlesr.harris@gmail.com> wrote:
> >
> > On Mon, Sep 29, 2008 at 11:27 AM, Robert Kern <robert.kern@gmail.com>
> wrote:
> >>
> >> On Mon, Sep 29, 2008 at 12:23, Charles R Harris
> >> <charlesr.harris@gmail.com> wrote:
> >> >
> >> >
> >> > On Mon, Sep 29, 2008 at 11:14 AM, Pauli Virtanen <pav@iki.fi> wrote:
> >> >>
> >> >> Mon, 29 Sep 2008 11:05:09 -0600, Charles R Harris wrote:
> >> >> [clip: assert in tests]
> >> >> > Using assert for this sort of thing is a bug, assert goes away with
> >> >> > the
> >> >> > -OO options. This needs to be fixed.
> >> >>
> >> >> "assert FOO" is used in quite many of Numpy's test cases, and it
> >> >> appears
> >> >> Nose endorses using assert (and uses it in its own tests).
> >> >>
> >> >> Should we go ahead and change all "assert FOO" in Numpy's tests to
> >> >> something like 'self.failUnless'?
> >> >
> >> > I fixed the np.testing functions to use
> >> >
> >> > if (foo) :
> >> >     raise AssertionError("Da Bomb")
> >> >
> >> > That way no changes to exception catching are needed, but the error
> will
> >> > still be raised when the -OO option is used. Strictly speaking, it
> isn't
> >> > quite right, but so it goes...
> >>
> >> When is -OO ever used for running tests? The assert statement is used
> >> for tests under nose.
> >
> > When it is the default on windows platforms. There was a ticket..
>
> I see #893, which talks about when -OO is used explicitly and when
> numpy is part of a py2exe application. This does not refer to any
> default configuration on Windows platforms.
>

Let's put it this way, if the tests were consistent with assert then they
couldn't be run with the -OO option. If they *can* be run with the -OO
option then they had better run correctly.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080929/8b666c96/attachment.html 


More information about the Numpy-discussion mailing list