[pypy-commit] pypy default: add a couple numpypy tests that currently fail
bdkearns
noreply at buildbot.pypy.org
Fri Feb 15 14:22:59 CET 2013
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r61255:76d38fa4395b
Date: 2013-02-15 08:21 -0500
http://bitbucket.org/pypy/pypy/changeset/76d38fa4395b/
Log: add a couple numpypy tests that currently fail
diff --git a/pypy/module/micronumpy/test/test_module.py b/pypy/module/micronumpy/test/test_module.py
--- a/pypy/module/micronumpy/test/test_module.py
+++ b/pypy/module/micronumpy/test/test_module.py
@@ -13,11 +13,13 @@
assert sum(array(range(10))) == 45
def test_min(self):
- from _numpypy import array, min
+ from _numpypy import array, min, zeros
assert min(range(10)) == 0
assert min(array(range(10))) == 0
+ assert list(min(zeros((0, 2)), axis=1)) == []
def test_max(self):
- from _numpypy import array, max
+ from _numpypy import array, max, zeros
assert max(range(10)) == 9
assert max(array(range(10))) == 9
+ assert list(max(zeros((0, 2)), axis=1)) == []
diff --git a/pypy/module/test_lib_pypy/numpypy/core/test_fromnumeric.py b/pypy/module/test_lib_pypy/numpypy/core/test_fromnumeric.py
--- a/pypy/module/test_lib_pypy/numpypy/core/test_fromnumeric.py
+++ b/pypy/module/test_lib_pypy/numpypy/core/test_fromnumeric.py
@@ -127,7 +127,7 @@
assert reshape(a, (1, -1)).shape == (1, 105)
assert reshape(a, (1, 1, -1)).shape == (1, 1, 105)
assert reshape(a, (-1, 1, 1)).shape == (105, 1, 1)
-
+
def test_transpose(self):
from numpypy import arange, array, transpose, ones
x = arange(4).reshape((2,2))
@@ -136,7 +136,7 @@
raises(NotImplementedError, "transpose(x, axes=(1, 0, 2))")
# x = ones((1, 2, 3))
# assert transpose(x, (1, 0, 2)).shape == (2, 1, 3)
-
+
def test_fromnumeric(self):
from numpypy import array, swapaxes
x = array([[1,2,3]])
diff --git a/pypy/module/test_lib_pypy/numpypy/test_numpy.py b/pypy/module/test_lib_pypy/numpypy/test_numpy.py
--- a/pypy/module/test_lib_pypy/numpypy/test_numpy.py
+++ b/pypy/module/test_lib_pypy/numpypy/test_numpy.py
@@ -8,3 +8,11 @@
pass
import numpypy
import numpy # works after 'numpypy' has been imported
+
+ def test_min_max_after_import(self):
+ from numpypy import *
+ assert min(1, 100) == 1
+ assert min(100, 1) == 1
+
+ assert max(1, 100) == 100
+ assert max(100, 1) == 100
diff --git a/rpython/rlib/rstruct/runpack.py b/rpython/rlib/rstruct/runpack.py
--- a/rpython/rlib/rstruct/runpack.py
+++ b/rpython/rlib/rstruct/runpack.py
@@ -46,7 +46,7 @@
def __init__(self, fmt):
self.formats = []
self.fmt = fmt
-
+
def operate(self, fmtdesc, repetitions):
if fmtdesc.needcount:
self.formats.append((fmtdesc, repetitions, None))
@@ -110,5 +110,3 @@
unpacker = create_unpacker(fmt)
return unpacker.unpack(input)
runpack._annspecialcase_ = 'specialize:arg(0)'
-
-
More information about the pypy-commit
mailing list