def test_nin1_docstring(self): wrapped_fn = biggus._ufunc_wrapper(np.negative) doc = inspect.getdoc(wrapped_fn) expected = ('Return the elementwise evaluation of ' 'np.negative(a) as another Array.') self.assertEqual(doc, expected)
def test_nout2_ufunc(self): msg = "Unsupported ufunc 'modf' with 1 input arrays & 2 output arrays." with self.assertRaisesRegexp(ValueError, msg): biggus._ufunc_wrapper(np.modf)
def test_non_ufunc(self): msg = 'not a ufunc' with self.assertRaisesRegexp(TypeError, msg): biggus._ufunc_wrapper(lambda x: x)