[Numpy-discussion] using assertEqual in unittest to test two np.ndarray?
Sat Mar 21 05:30:40 CDT 2009
On Sat, Mar 21, 2009 at 10:15, <email@example.com> wrote:
> The testing assert functions are not well documented, I usually just
> use assert_array_almost_equal with decimal precision for float arrays.
> useful is also assert_() which is better than the assert statement
> since it survives optimization flag for python compile.
> You can browse the help editor
> To see the precise definition and difference between the different
> asserts you have to check the source, source button on editor page.
> There are also the
> http://projects.scipy.org/numpy/wiki/TestingGuidelines , if you
> haven't seen them yet, they describe the general test setup with nose
> but not the assert functions.
> If you know where to look there is some information:
> >>> help(numpy.testing.utils)
> Help on module numpy.testing.utils in numpy.testing:
> numpy.testing.utils - Utility function to facilitate testing.
> assert_almost_equal(actual, desired, decimal=7, err_msg='',
> Raise an assertion if two items are not equal.
> I think this should be part of unittest.py
> The test i
Thanks really~ It helped a lot. ;)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion