Commits

Brian Kearns committed 0edc9b6

test bin() of numpy scalar

  • Participants
  • Parent commits 3b5c5d8

Comments (0)

Files changed (1)

File pypy/module/micronumpy/test/test_scalar.py

         assert hex(np.int32(11)) == '0xb'
         assert hex(np.float32(11.6)) == '0xb'
         assert hex(np.complex64(11-12j)) == '0xb'
+        assert bin(np.int32(11)) == '0b1011'
+        exc = raises(TypeError, "bin(np.float32(11.6))")
+        assert exc.value.message.find('object cannot be interpreted as an index') != -1
 
     def test_pickle(self):
         from numpypy import dtype, zeros