found this and this but doesn't solve my issue.
I want to perform unit test by comparing two tuples as a whole, not element-wise. The tuples involve with int and list of boolean. Length of the list varies in my real situation. For simplicity, i fix the length of list at 2 for demonstration purpose. so the function i want to unit test gave output format look like this:
A = some_function(input)
where
$ some_function(input)
> (array([ True, True]), array([ True, False]), 2)
I tried to unit test A by creating B, like so:
B = (np.array([True, True]), np.array([True, False]), 2)
I have tried the followings but both return False instead of True as I'd expect. Why? how can i fix it?
np.array_equal(A,B)
> False
np.array_equiv(A,B)
> False
A==B
>ValueError Traceback (most recent call last)
<ipython-input-125-2c88eac8e390> in <module>
1 A=_tokenwise_to_entitywise(ref,hyp)
----> 2 B== (np.array([True,True]), np.array([True,False]), 2)
3
4 A==B
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()