Suppose you need to compare two tuples. We can use the assert_equal
function to do that:
assert_equal
function:print "Equal?", np.testing.assert_equal((1, 2), (1, 3))
An exception is thrown:
Equal? Traceback (most recent call last): ... raiseAssertionError(msg) AssertionError: Items are not equal: item=1 ACTUAL: 2 DESIRED: 3