summaryrefslogtreecommitdiff
path: root/numpy/testing/tests/test_utils.py
diff options
context:
space:
mode:
authorJonathan Tammo Siebert <siebertjonathan@aim.com>2016-12-19 07:29:28 +0100
committerJonathan Siebert <siebertjonathan@aim.com>2017-01-04 22:36:47 +0100
commita2f9fe71ce3e2d4a0c8622617a852551feadf01a (patch)
tree7f48877d54c5614d9241eb5f798de9b48a3f0450 /numpy/testing/tests/test_utils.py
parent617707ec85f2ee59e618bce78d9751414c93d6cb (diff)
downloadnumpy-a2f9fe71ce3e2d4a0c8622617a852551feadf01a.tar.gz
TST: Added test that np.inf is not approx. -np.inf
This failed to raise AssertionError in an earlier rewrite of assert_array_compare and is thus tested explicitly now.
Diffstat (limited to 'numpy/testing/tests/test_utils.py')
-rw-r--r--numpy/testing/tests/test_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index bcbb9e2a8..4ca6c6354 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -291,6 +291,9 @@ class TestArrayAlmostEqual(_GenericTest, unittest.TestCase):
a[0, 0] = np.inf
self.assertRaises(AssertionError,
lambda: self._assert_func(a, b))
+ b[0, 0] = -np.inf
+ self.assertRaises(AssertionError,
+ lambda: self._assert_func(a, b))
def test_subclass(self):
a = np.array([[1., 2.], [3., 4.]])
@@ -337,6 +340,8 @@ class TestAlmostEqual(_GenericTest, unittest.TestCase):
self._assert_func(-np.inf, -np.inf)
self.assertRaises(AssertionError,
lambda: self._assert_func(np.inf, 1))
+ self.assertRaises(AssertionError,
+ lambda: self._assert_func(-np.inf, np.inf))
def test_simple_item(self):
self._test_not_equal(1, 2)