diff options
author | David Cournapeau <cournape@gmail.com> | 2008-04-07 23:53:13 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-04-07 23:53:13 +0000 |
commit | dff402067c11e6bc82ce5cd8c344024f51095551 (patch) | |
tree | 006854e2e7b4a92c654e577ee8c2de7dda31d468 /numpy/testing/tests | |
parent | dd33570b5975588b10dbfb910c2fac8bb796807a (diff) | |
download | numpy-dff402067c11e6bc82ce5cd8c344024f51095551.tar.gz |
Test assert* funcs for arrays with Nan and rec arrays.
Diffstat (limited to 'numpy/testing/tests')
-rw-r--r-- | numpy/testing/tests/test_utils.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index 705027c5c..0ce8551c4 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -44,6 +44,13 @@ class TestEqual: self._test_not_equal(a, b) + def test_nan_array(self): + """Test two arrays with different shapes are found not equal.""" + a = N.array([1, 2]) + b = N.array([[1, 2], [1, 2]]) + + self._test_not_equal(a, b) + def test_string_arrays(self): """Test two arrays with different shapes are found not equal.""" a = N.array(['floupi', 'floupa']) @@ -55,3 +62,18 @@ class TestEqual: self._test_not_equal(c, b) + def test_recarrays(self): + """Test record arrays.""" + a = N.empty(2, [('floupi', N.float), ('floupa', N.float)]) + a['floupi'] = [1, 2] + a['floupa'] = [1, 2] + b = a.copy() + + self._test_equal(a, b) + + c = N.empty(2, [('floupipi', N.float), ('floupa', N.float)]) + c['floupipi'] = a['floupi'].copy() + c['floupa'] = a['floupa'].copy() + + self._test_not_equal(c, b) + |