diff options
Diffstat (limited to 'numpy/testing/nose_tools/utils.py')
-rw-r--r-- | numpy/testing/nose_tools/utils.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/testing/nose_tools/utils.py b/numpy/testing/nose_tools/utils.py index 973e3bb4b..2d97b5c1e 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): @@ -1846,6 +1849,7 @@ def _gen_alignment_data(dtype=float32, type='binary', max_size=24): class IgnoreException(Exception): "Ignoring this exception due to disabled feature" + pass @contextlib.contextmanager |