From c1031bd7d85f6f16079c685c20d41877107521c6 Mon Sep 17 00:00:00 2001 From: Daniel da Silva Date: Sun, 9 Mar 2014 22:43:13 -0400 Subject: ENH: Explicitly use __eq__ in assert_equal(a,b) Fixes #2552. Changes primary test expression in function. --- numpy/testing/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numpy/testing/utils.py') diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 4905898d2..01c0e769b 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -318,7 +318,9 @@ def assert_equal(actual,desired,err_msg='',verbose=True): # as before except (TypeError, ValueError, NotImplementedError): pass - if desired != actual : + + # Explicitly use __eq__ for comparison, ticket #2552 + if not (desired == actual): raise AssertionError(msg) def print_assert_equal(test_string, actual, desired): -- cgit v1.2.1