Author: Matti Picus <matti.pi...@gmail.com>
Branch: 
Changeset: r61007:a9b26dd44954
Date: 2013-02-09 22:33 +0200
http://bitbucket.org/pypy/pypy/changeset/a9b26dd44954/

Log:    move test, skip if not python2.7 or greater, accept either
        ValueError or TypeError for -A compatibility

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
@@ -484,7 +484,6 @@
         assert numpy.float64(2.0) == 2.0
         assert numpy.float64('23.4') == numpy.float64(23.4)
         raises(ValueError, numpy.float64, '23.2df')
-        assert "{:g}".format(numpy.complex_(0.5+1.5j)) == 
'{:g}'.format(0.5+1.5j)
 
     def test_longfloat(self):
         import _numpypy as numpy
@@ -541,7 +540,14 @@
 
         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)
+        try:
+            numpy.array([3+4j], dtype=float)
+        except (ValueError, TypeError):
+            pass
+        else:
+            assert False, 'should have raised'
+        if sys.version_info >= (2, 7):
+            assert "{:g}".format(numpy.complex_(0.5+1.5j)) == 
'{:g}'.format(0.5+1.5j)
 
     def test_complex(self):
         import _numpypy as numpy
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to