summaryrefslogtreecommitdiff
path: root/numpy/testing/nose_tools/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/testing/nose_tools/utils.py')
-rw-r--r--numpy/testing/nose_tools/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/testing/nose_tools/utils.py b/numpy/testing/nose_tools/utils.py
index 973e3bb4b..6c77e5e21 100644
--- a/numpy/testing/nose_tools/utils.py
+++ b/numpy/testing/nose_tools/utils.py
@@ -394,14 +394,17 @@ def assert_equal(actual, desired, err_msg='', verbose=True):
isdesnat = isnat(desired)
isactnat = isnat(actual)
dtypes_match = array(desired).dtype.type == array(actual).dtype.type
- if isdesnat and isactnat and dtypes_match:
+ if isdesnat and isactnat:
# If both are NaT (and have the same dtype -- datetime or
# timedelta) they are considered equal.
- return
+ if dtypes_match:
+ return
+ else:
+ raise AssertionError(msg)
+
except (TypeError, ValueError, NotImplementedError):
pass
-
try:
# Explicitly use __eq__ for comparison, gh-2552
if not (desired == actual):