Commits

Brian Kearns committed 23bd556

small additions/tightenings for numpypy tests

Comments (0)

Files changed (1)

pypy/module/micronumpy/test/test_dtypes.py

         d = dtype('?')
         assert d.num == 0
         assert d.kind == 'b'
+        assert dtype(d) is d
+        assert dtype('bool') is d
+
         assert dtype('int8').num == 1
-        assert dtype(d) is d
-        assert dtype(None) is dtype(float)
         assert dtype('int8').name == 'int8'
         assert dtype(int).fields is None
         assert dtype(int).names is None
+
+        assert dtype(None) is dtype(float)
+
         raises(TypeError, dtype, 1042)
         raises(KeyError, 'dtype(int)["asdasd"]')
 
         for d1, d2, dout in tests:
             # make a failed test print helpful info
             d3 = (array([1], d1) + array([1], d2)).dtype
-            assert (d1, d2, repr(d3)) == (d1, d2, repr(dtype(dout)))
+            assert (d1, d2) == (d1, d2) and d3 is dtype(dout)
 
     def test_add_int8(self):
         from _numpypy import array, dtype
                                        numpy.inexact, numpy.number, 
                                        numpy.generic, object]
         a = numpy.array([1, 2, 3], numpy.longdouble)
-        assert repr(type(a[1])) == repr(numpy.longdouble)
+        assert type(a[1]) is numpy.longdouble
         assert numpy.float64(12) == numpy.longdouble(12)
         assert numpy.float64(12) == numpy.longfloat(12)
         raises(ValueError, numpy.longfloat, '23.2df')
         assert repr(c128) == should
 
         c64 = numpy.complex64(complex(real, imag))
-        assert repr(c64.real) == 'inf'  
+        assert repr(c64.real) == 'inf'
         assert type(c64.real) is type(c64.imag) is numpy.float32
         assert repr(c64.imag).startswith('inf')
         assert repr(c64) in ('(inf+inf*j)', '(inf+infj)')
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.