diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-12-18 21:22:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 21:22:42 -0800 |
commit | abb9bb52d9e09780a6519c42a2900f83a4bdc557 (patch) | |
tree | f9a626c4eb7dd58b23dd454b03bd7cead8e54bbb /numpy/testing/nose_tools/utils.py | |
parent | 34c9950ccdb8a2f64916903b09c2c39233be0adf (diff) | |
parent | 0f13a2e7fa626dbde62bdda7a92fc0a6361981ba (diff) | |
download | numpy-abb9bb52d9e09780a6519c42a2900f83a4bdc557.tar.gz |
Merge branch 'master' into move_histogram
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): |