diff options
author | Matti Picus <matti.picus@gmail.com> | 2018-08-01 13:01:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 13:01:31 -0400 |
commit | b72d52a464661a224d6672789a85e8965eae19ca (patch) | |
tree | 66ca5be4c3b8abbaffde6774906f90567fe68138 /numpy/lib/tests | |
parent | 066298b46f5d63ba6c144c4750444cde9a983b87 (diff) | |
parent | b11b7645cc86a4b5fab6adb7703ce87f482af6c3 (diff) | |
download | numpy-b72d52a464661a224d6672789a85e8965eae19ca.tar.gz |
Merge pull request #11503 from jor-/master
MAINT: improve error message for isposinf and isneginf on complex values
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_ufunclike.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py index 361367b97..0f06876a1 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(TypeError): + 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(TypeError): + 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) |