summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorJoscha Reimer <jor@informatik.uni-kiel.de>2018-07-27 10:27:45 +0200
committerJoscha Reimer <jor@informatik.uni-kiel.de>2018-07-27 10:28:44 +0200
commit878bad2320910a24335401b37415c50442825ae6 (patch)
tree8d7e45c29a8bb4e246a4c95adf62970aeb37b7c0 /numpy/lib/tests
parent5316e76b40fdeae5fdb7b2346f66f02c74842803 (diff)
downloadnumpy-878bad2320910a24335401b37415c50442825ae6.tar.gz
TEST: numpy.lib.ufunclike: isposinf and isneginf are tested with complex values whether exception is raised
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_ufunclike.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py
index 5604b3744..7c41ed1a3 100644
--- a/numpy/lib/tests/test_ufunclike.py
+++ b/numpy/lib/tests/test_ufunclike.py
@@ -4,8 +4,8 @@ import numpy as np
import numpy.core as nx
import numpy.lib.ufunclike as ufl
from numpy.testing import (
- assert_, assert_equal, assert_array_equal, assert_warns
- )
+ assert_, assert_equal, assert_array_equal, assert_warns, assert_raises
+)
class TestUfunclike(object):
@@ -21,6 +21,10 @@ class TestUfunclike(object):
assert_equal(res, tgt)
assert_equal(out, tgt)
+ a = a.astype(np.complex)
+ with assert_raises(ValueError):
+ ufl.isposinf(a)
+
def test_isneginf(self):
a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0])
out = nx.zeros(a.shape, bool)
@@ -32,6 +36,10 @@ class TestUfunclike(object):
assert_equal(res, tgt)
assert_equal(out, tgt)
+ a = a.astype(np.complex)
+ with assert_raises(ValueError):
+ ufl.isneginf(a)
+
def test_fix(self):
a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]])
out = nx.zeros(a.shape, float)