[pypy-commit] pypy numpypy-argminmax: add a failing test

mattip noreply at buildbot.pypy.org
Wed Jun 13 22:49:16 CEST 2012


Author: mattip <matti.picus at gmail.com>
Branch: numpypy-argminmax
Changeset: r55653:d3547c6d039b
Date: 2012-06-13 23:46 +0300
http://bitbucket.org/pypy/pypy/changeset/d3547c6d039b/

Log:	add a failing test

diff --git a/pypy/module/micronumpy/test/test_outarg.py b/pypy/module/micronumpy/test/test_outarg.py
--- a/pypy/module/micronumpy/test/test_outarg.py
+++ b/pypy/module/micronumpy/test/test_outarg.py
@@ -1,4 +1,3 @@
-import py
 from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest
 
 class AppTestOutArg(BaseNumpyAppTest):
@@ -124,3 +123,15 @@
             cast_error = raises(TypeError, negative, c, a)
             assert str(cast_error.value) == \
             "Cannot cast ufunc negative output from dtype('float64') to dtype('int64') with casting rule 'same_kind'"
+
+    def test_argminmax(self):
+        from numpypy import arange
+        a = arange(15).reshape(5, 3)
+        b = arange(15).reshape(5,3)
+        c = a.argmax(0, out=b[1])
+        assert (c == [4, 4, 4]).all()
+        assert (c == b[1]).all()
+        c = a.argmax(1, out=b[:,1])
+        assert (c == [2, 2, 2, 2, 2]).all()
+        assert (c == b[:,1]).all()
+


More information about the pypy-commit mailing list