[pypy-commit] pypy array_equal: move array_equal tests to test_lib_pypy, as requested
MichaelBlume
noreply at buildbot.pypy.org
Thu Mar 22 17:08:26 CET 2012
Author: Mike Blume <mike at loggly.com>
Branch: array_equal
Changeset: r53906:723f22fc5b96
Date: 2012-03-22 08:49 -0700
http://bitbucket.org/pypy/pypy/changeset/723f22fc5b96/
Log: move array_equal tests to test_lib_pypy, as requested
diff --git a/pypy/module/micronumpy/test/test_numarray.py b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -203,44 +203,6 @@
assert a.shape == (3,)
assert a.dtype is dtype(int)
- def test_equal(self):
- from _numpypy import array
- from numpypy import array_equal
-
- a = [1, 2, 3]
- b = [1, 2, 3]
-
- assert array_equal(a, b)
- assert array_equal(a, array(b))
- assert array_equal(array(a), b)
- assert array_equal(array(a), array(b))
-
- def test_not_equal(self):
- from _numpypy import array
- from numpypy import array_equal
-
- a = [1, 2, 3]
- b = [1, 2, 4]
-
- assert not array_equal(a, b)
- assert not array_equal(a, array(b))
- assert not array_equal(array(a), b)
- assert not array_equal(array(a), array(b))
-
- def test_mismatched_shape(self):
- from _numpypy import array
- from numpypy import array_equal
-
- a = [1, 2, 3]
- b = [[1, 2, 3], [1, 2, 3]]
-
- assert not array_equal(a, b)
- assert not array_equal(a, array(b))
- assert not array_equal(array(a), b)
- assert not array_equal(array(a), array(b))
-
-
-
def test_type(self):
from _numpypy import array
ar = array(range(5))
diff --git a/pypy/module/test_lib_pypy/numpypy/core/test_numeric.py b/pypy/module/test_lib_pypy/numpypy/core/test_numeric.py
--- a/pypy/module/test_lib_pypy/numpypy/core/test_numeric.py
+++ b/pypy/module/test_lib_pypy/numpypy/core/test_numeric.py
@@ -142,3 +142,39 @@
assert str(b) == "[7 8 9]"
b = a[2:1, ]
assert str(b) == "[]"
+
+ def test_equal(self):
+ from _numpypy import array
+ from numpypy import array_equal
+
+ a = [1, 2, 3]
+ b = [1, 2, 3]
+
+ assert array_equal(a, b)
+ assert array_equal(a, array(b))
+ assert array_equal(array(a), b)
+ assert array_equal(array(a), array(b))
+
+ def test_not_equal(self):
+ from _numpypy import array
+ from numpypy import array_equal
+
+ a = [1, 2, 3]
+ b = [1, 2, 4]
+
+ assert not array_equal(a, b)
+ assert not array_equal(a, array(b))
+ assert not array_equal(array(a), b)
+ assert not array_equal(array(a), array(b))
+
+ def test_mismatched_shape(self):
+ from _numpypy import array
+ from numpypy import array_equal
+
+ a = [1, 2, 3]
+ b = [[1, 2, 3], [1, 2, 3]]
+
+ assert not array_equal(a, b)
+ assert not array_equal(a, array(b))
+ assert not array_equal(array(a), b)
+ assert not array_equal(array(a), array(b))
More information about the pypy-commit
mailing list