Commits

Taavi Burns committed 64bcad2

Adds a few more tests of types for zeros_like and ones_like.

Comments (0)

Files changed (1)

pypy/module/micronumpy/test/test_ufuncs.py

         assert logaddexp2(float('inf'), float('inf')) == float('inf')
 
     def test_ones_like(self):
-        from numpypy import array, complex, ones_like
+        from numpypy import array, ones_like
 
+        assert ones_like(False) == array(True)
         assert ones_like(2) == array(1)
+        assert ones_like(2.) == array(1.)
         assert ones_like(complex(2)) == array(complex(1))
 
     def test_zeros_like(self):
-        from numpypy import array, complex, zeros_like
+        from numpypy import array, zeros_like
 
+        assert zeros_like(True) == array(False)
         assert zeros_like(2) == array(0)
+        assert zeros_like(2.) == array(0.)
         assert zeros_like(complex(2)) == array(complex(0))