[Numpy-discussion] ANN: NumPy 1.2.0
Mon Sep 29 14:08:29 CDT 2008
A Monday 29 September 2008, Robert Kern escrigué:
> On Mon, Sep 29, 2008 at 13:43, Francesc Alted <email@example.com>
> > 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
> """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.
More information about the Numpy-discussion