summaryrefslogtreecommitdiff
path: root/numpy/testing/tests/test_utils.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-04-07 23:02:05 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-04-07 23:02:05 +0000
commite18fb0b5eecbd5bd54c1e19a7673ecfb71bb19cf (patch)
treeed4e6c4bc573655a58ad1045bdfe1204f9f804c7 /numpy/testing/tests/test_utils.py
parent8ec87751bf69a3ab3e15c72825a70c08f884b5bb (diff)
downloadnumpy-e18fb0b5eecbd5bd54c1e19a7673ecfb71bb19cf.tar.gz
Start testing test functions.
Diffstat (limited to 'numpy/testing/tests/test_utils.py')
-rw-r--r--numpy/testing/tests/test_utils.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
new file mode 100644
index 000000000..2347c3762
--- /dev/null
+++ b/numpy/testing/tests/test_utils.py
@@ -0,0 +1,30 @@
+import numpy as N
+from numpy.testing.utils import *
+
+class TestEqual:
+ def _test_equal(self, a, b):
+ assert_array_equal(a, b)
+
+ def _test_not_equal(self, a, b):
+ passed = False
+ try:
+ assert_array_equal(a, b)
+ passed = True
+ except AssertionError:
+ pass
+
+ if passed:
+ raise AssertionError("a and b are found equal but are not")
+
+ def test_array_rank1_eq(self):
+ """Test two equal array are found equal."""
+ a = N.array([1, 2])
+ b = N.array([1, 2])
+
+ self._test_equal(a, b)
+
+ def test_array_rank1_noteq(self):
+ a = N.array([1, 2])
+ b = N.array([2, 2])
+
+ self._test_not_equal(a, b)