summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/ma/core.py2
-rw-r--r--numpy/ma/tests/test_core.py8
2 files changed, 7 insertions, 3 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 89294e403..4fb7d8c28 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -2812,7 +2812,7 @@ class MaskedArray(ndarray):
def __new__(cls, data=None, mask=nomask, dtype=None, copy=False,
subok=True, ndmin=0, fill_value=None, keep_mask=True,
- hard_mask=None, shrink=True, order=None, **options):
+ hard_mask=None, shrink=True, order=None):
"""
Create a new masked array from scratch.
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 6a2ed8ca7..0b2e7303c 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -244,6 +244,10 @@ class TestMaskedArray:
'offsets':[0,8]})
array(x) # used to fail due to 'V' padding field in x.dtype.descr
+ def test_unknown_keyword_parameter(self):
+ with pytest.raises(TypeError, match="unexpected keyword argument"):
+ MaskedArray([1, 2, 3], maks=[0, 1, 0]) # `mask` is misspelled.
+
def test_asarray(self):
(x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d
xm.fill_value = -9999
@@ -4601,7 +4605,7 @@ class TestMaskedArrayFunctions:
class M(MaskedArray):
pass
- test = np.ma.compressed(M(shape=(0,1,2)))
+ test = np.ma.compressed(M([[[]], [[]]]))
assert_equal(test.ndim, 1)
# with .compressed() overridden
@@ -4609,7 +4613,7 @@ class TestMaskedArrayFunctions:
def compressed(self):
return 42
- test = np.ma.compressed(M(shape=(0,1,2)))
+ test = np.ma.compressed(M([[[]], [[]]]))
assert_equal(test, 42)
def test_convolve(self):