[pypy-commit] pypy numpy-monkeyaround: Add test for arange

mattip noreply at buildbot.pypy.org
Mon Nov 21 05:18:06 CET 2011


Author: mattip
Branch: numpy-monkeyaround
Changeset: r49593:1c02422a8f96
Date: 2011-11-21 05:41 +0200
http://bitbucket.org/pypy/pypy/changeset/1c02422a8f96/

Log:	Add test for arange

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
@@ -1000,3 +1000,19 @@
         assert str(b) == "[7 8 9]"
         b = a[2:1, ]
         assert str(b) == "[]"
+
+class AppTestRanges(BaseNumpyAppTest):
+    def test_arange(self):
+        from numpypy import arange, array
+        a = arange(3)
+        assert (a == [0, 1, 2]).all()
+        assert a.dtype is dtype(int)
+        a = arange(3.0)
+        assert (a == [0., 1., 2.]).all()
+        assert a.dtype is dtype(float)
+        a = arange(3, 7)
+        assert (a == [3, 4, 5, 6]).all()
+        assert a.dtype is dtype(int)
+        a = arange(3, 7, 2)
+        assert (a == [3, 5]).all()
+


More information about the pypy-commit mailing list