diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/lib/tests/test_ufunclike.py | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py index 182d17c56..5604b3744 100644 --- a/numpy/lib/tests/test_ufunclike.py +++ b/numpy/lib/tests/test_ufunclike.py @@ -11,28 +11,26 @@ from numpy.testing import ( class TestUfunclike(object): def test_isposinf(self): - for dtype in [np.float, np.complex]: - a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0], dtype=dtype) - out = nx.zeros(a.shape, bool) - tgt = nx.array([True, False, False, False, False, False]) + a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0]) + out = nx.zeros(a.shape, bool) + tgt = nx.array([True, False, False, False, False, False]) - res = ufl.isposinf(a) - assert_equal(res, tgt) - res = ufl.isposinf(a, out) - assert_equal(res, tgt) - assert_equal(out, tgt) + res = ufl.isposinf(a) + assert_equal(res, tgt) + res = ufl.isposinf(a, out) + assert_equal(res, tgt) + assert_equal(out, tgt) def test_isneginf(self): - for dtype in [np.float, np.complex]: - a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0], dtype=dtype) - out = nx.zeros(a.shape, bool) - tgt = nx.array([False, True, False, False, False, False]) - - res = ufl.isneginf(a) - assert_equal(res, tgt) - res = ufl.isneginf(a, out) - assert_equal(res, tgt) - assert_equal(out, tgt) + a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0]) + out = nx.zeros(a.shape, bool) + tgt = nx.array([False, True, False, False, False, False]) + + res = ufl.isneginf(a) + assert_equal(res, tgt) + res = ufl.isneginf(a, out) + assert_equal(res, tgt) + assert_equal(out, tgt) def test_fix(self): a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]]) |