summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
diff options
context:
space:
mode:
authorChiara Marmo <marmochiaskl@gmail.com>2022-07-25 14:00:02 -1000
committerChiara Marmo <marmochiaskl@gmail.com>2022-07-25 15:41:39 -1000
commit44c8da9f2caa5e09c78204e487cf74fe53c6d0d4 (patch)
tree2590b7ffdab15cea2e156c4eaefd55e7c2e4030a /numpy/ma/tests
parent45bc13e6d922690eea43b9d807d476e0f243f836 (diff)
downloadnumpy-44c8da9f2caa5e09c78204e487cf74fe53c6d0d4.tar.gz
Make mask_invalid consistent with mask_where when copy is set to False. Add test for type erroring.
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r--numpy/ma/tests/test_core.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index b056d5169..5a6d642b4 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -4496,6 +4496,13 @@ class TestMaskedArrayFunctions:
assert_equal(ma, expected)
assert_equal(ma.mask, expected.mask)
+ def test_masked_invalid_error(self):
+ a = np.arange(5, dtype=object)
+ a[3] = np.PINF
+ a[2] = np.NaN
+ with pytest.raises(TypeError, match="not supported for the input types"):
+ np.ma.masked_invalid(a)
+
def test_choose(self):
# Test choose
choices = [[0, 1, 2, 3], [10, 11, 12, 13],