Hi all,
When I try to use assertEqual in unittest to test my numpy codes I got this:
======================================================================
ERROR: test_test (__main__.Test_data_ana)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./unit_test.py", line 24, in test_test
[4, 5, 6]]))
File "/usr/lib/python2.5/unittest.py", line 332, in failUnlessEqual
if not first == second:
ValueError: The truth value of an array with more than one element is
ambiguous. Use a.any() or a.all()
----------------------------------------------------------------------
Ran 2 tests in 0.003s
FAILED (errors=1)
================================================
I know I should use array_equal to test two arrays but it will be more
convenient to implement it as __eq__. Any hints? Thanks in advance.
--
Cheers,
Grissiom
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion