[Numpy-discussion] ANN: NumPy 1.2.0

Francesc Alted faltet at pytables.org
Mon Sep 29 15:08:29 EDT 2008


A Monday 29 September 2008, Robert Kern escrigué:
> On Mon, Sep 29, 2008 at 13:43, Francesc Alted <faltet at pytables.org> 
wrote:
> > Plain assert clauses used to be the most common way to check for
> > test units in the original "unittest" module.  Later on, the
> > authors started to introduce things like self.assert_() and family
> > and warned that the use of the "assert" clause should be avoided
> > (maybe thinking about possible changes in semantics inside Python
> > itself, maybe thinking about the use of -OO).
>
> Mostly it was reporting, I think. With assertEquals(x,y), you get a
> nice message showing the values of x and y. This is obviated by nose,
> which can introspect to get the values. From the unittest
> documentation:
>
>   """These methods are used instead of the assert statement so the
> test runner can accumulate all test results and produce a report."""

Maybe.  At any rate, getting rid of plain asserts in test units seems to 
be a good practice generally speaking.

Cheers,

-- 
Francesc Alted



More information about the NumPy-Discussion mailing list