[pypy-commit] pypy numpypy-complex2: fix for -A, add test for failing to convert complex to float

mattip noreply at buildbot.pypy.org
Sun Sep 9 22:29:09 CEST 2012


Author: mattip <matti.picus at gmail.com>
Branch: numpypy-complex2
Changeset: r57257:17c968169e3b
Date: 2012-09-09 23:22 +0300
http://bitbucket.org/pypy/pypy/changeset/17c968169e3b/

Log:	fix for -A, add test for failing to convert complex to float

diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -450,7 +450,7 @@
         real, imag, should = (1e100, 3e66, '(1e+100+3e+66j)')
         c128 = numpy.complex128(complex(real, imag))
         assert type(c128.real) is type(c128.imag)
-        assert type(c128.real) is float
+        assert type(c128.real) is numpy.float64
         assert c128.real == real
         assert c128.imag == imag
         assert repr(c128) == should
@@ -464,6 +464,7 @@
 
         assert numpy.complex128(1.2) == numpy.complex128(complex(1.2, 0))
         assert numpy.complex64(1.2) == numpy.complex64(complex(1.2, 0))
+        raises (TypeError, numpy.array, [3+4j], dtype=float)
 
     def test_complex(self):
         import _numpypy as numpy


More information about the pypy-commit mailing list