summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index e345f5668..696d9bc85 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -781,6 +781,38 @@ class TestNaNFuncts(TestCase):
assert_equal(np.isinf(a), np.zeros((2, 4), dtype=bool))
+class TestNanFunctsIntTypes(TestCase):
+
+ int_types = (int8, int16, int32, int64, uint8, uint16, uint32, uint64)
+
+ def setUp(self, *args, **kwargs):
+ self.A = array([127, 39, 93, 87, 46])
+
+ def integer_arrays(self):
+ for dtype in self.int_types:
+ yield self.A.astype(dtype)
+
+ def test_nanmin(self):
+ min_value = min(self.A)
+ for A in self.integer_arrays():
+ assert_equal(nanmin(A), min_value)
+
+ def test_nanmax(self):
+ max_value = max(self.A)
+ for A in self.integer_arrays():
+ assert_equal(nanmax(A), max_value)
+
+ def test_nanargmin(self):
+ min_arg = argmin(self.A)
+ for A in self.integer_arrays():
+ assert_equal(nanargmin(A), min_arg)
+
+ def test_nanargmax(self):
+ max_arg = argmax(self.A)
+ for A in self.integer_arrays():
+ assert_equal(nanargmax(A), max_arg)
+
+
class TestCorrCoef(TestCase):
def test_simple(self):
A = array([[ 0.15391142, 0.18045767, 0.14197213],