diff options
| author | Josh Wilson <person142@users.noreply.github.com> | 2016-10-19 21:04:59 -0500 |
|---|---|---|
| committer | Josh Wilson <person142@users.noreply.github.com> | 2016-10-19 21:04:59 -0500 |
| commit | 41aee80cc64d5679ca8cb9e8ce6247c738b942d4 (patch) | |
| tree | 2e0ef4d5bb609877ae87291c5044ecb152ee9443 /numpy/testing/tests | |
| parent | 6da5f00fff528354d3676617b91b024007e62ecd (diff) | |
| download | numpy-41aee80cc64d5679ca8cb9e8ce6247c738b942d4.tar.gz | |
MAINT: make `assert_allclose` behavior on `nan`s match pre 1.12
Diffstat (limited to 'numpy/testing/tests')
| -rw-r--r-- | numpy/testing/tests/test_utils.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index 5ca29d3c5..474a7edd5 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -7,8 +7,9 @@ import os import numpy as np from numpy.testing import ( assert_equal, assert_array_equal, assert_almost_equal, - assert_array_almost_equal, build_err_msg, raises, assert_raises, - assert_warns, assert_no_warnings, assert_allclose, assert_approx_equal, + assert_array_almost_equal, assert_array_less, build_err_msg, + raises, assert_raises, assert_warns, assert_no_warnings, + assert_allclose, assert_approx_equal, assert_array_almost_equal_nulp, assert_array_max_ulp, clear_and_catch_warnings, suppress_warnings, run_module_suite, assert_string_equal, assert_, tempdir, temppath, @@ -566,6 +567,17 @@ class TestAssertAllclose(unittest.TestCase): self.assertRaises(AssertionError, assert_allclose, a, b, equal_nan=False) + def test_equal_nan_default(self): + # Make sure equal_nan default behavior remains unchanged. (All + # of these functions use assert_array_compare under the hood.) + # None of these should raise. + a = np.array([np.nan]) + b = np.array([np.nan]) + assert_array_equal(a, b) + assert_array_almost_equal(a, b) + assert_array_less(a, b) + assert_allclose(a, b) + class TestArrayAlmostEqualNulp(unittest.TestCase): |
