[pypy-commit] pypy numpypy-out: add a failing test
mattip
noreply at buildbot.pypy.org
Fri Feb 17 00:25:19 CET 2012
Author: mattip
Branch: numpypy-out
Changeset: r52574:4eef3287c40b
Date: 2012-02-17 01:15 +0200
http://bitbucket.org/pypy/pypy/changeset/4eef3287c40b/
Log: add a failing test
diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -783,7 +783,6 @@
self.values = None
def create_sig(self):
- print 'Call1::create_sig'
if self.forced_result is not None:
return self.forced_result.create_sig()
return signature.Call1(self.ufunc, self.name, self.calc_dtype,
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
@@ -39,6 +39,21 @@
#test for view, and also test that forcing out also forces b
assert (c[:, :, 1] == [[0, 0], [-4, -8]]).all()
assert (b == [[-2, -4], [-6, -8]]).all()
+ #Test broadcast, type promotion
+ b = negative(3, out=a)
+ assert (a == -3).all()
+ c = zeros((2, 2), dtype=float)
+ b = negative(3, out=c)
+ assert b.dtype.kind == c.dtype.kind
+ assert b.shape == c.shape
+
+ #Test shape agreement
+ a=zeros((3,4))
+ b=zeros((3,5))
+ raises(ValueError, 'negative(a, out=b)')
+ raises(ValueError, 'negative(a, out=b)')
+
+
def test_ufunc_cast(self):
from _numpypy import array, negative
More information about the pypy-commit
mailing list