diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-12-11 15:42:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 15:42:27 -0700 |
commit | 7a8c6b476786c86deeb87ad90f8920130821e355 (patch) | |
tree | 73c7e7e4daef00e5907c3ae7445fa9b87e1db8d6 /numpy/testing/nose_tools/utils.py | |
parent | d0bdc76786553bc3c4b1688335b731590ea52a8d (diff) | |
parent | b98e5984c2c74c61b5ee452ce7553640622b46e7 (diff) | |
download | numpy-7a8c6b476786c86deeb87ad90f8920130821e355.tar.gz |
Merge pull request #10193 from charris/fix-deprecation-warning
BUG: Fix bugs found by testing in release mode.
Diffstat (limited to 'numpy/testing/nose_tools/utils.py')
-rw-r--r-- | numpy/testing/nose_tools/utils.py | 9 |
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): |