Commits

mattip committed a9b26dd

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

Comments (0)

Files changed (1)

pypy/module/micronumpy/test/test_dtypes.py

         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
 
         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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.