summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_extras.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/tests/test_extras.py')
-rw-r--r--numpy/ma/tests/test_extras.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index faee4f599..f11180672 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -672,12 +672,16 @@ class TestMedian(TestCase):
x = np.arange(9)
assert_equal(np.ma.median(x), 4.)
assert_(type(np.ma.median(x)) is not MaskedArray)
- x = range(9)
- assert_equal(np.ma.median(x), 4.)
+ x = range(8)
+ assert_equal(np.ma.median(x), 3.5)
assert_(type(np.ma.median(x)) is not MaskedArray)
x = 5
assert_equal(np.ma.median(x), 5.)
assert_(type(np.ma.median(x)) is not MaskedArray)
+ # Regression test for gh-8409: even number of entries.
+ x = [5., 5.]
+ assert_equal(np.ma.median(x), 5.)
+ assert_(type(np.ma.median(x)) is not MaskedArray)
def test_docstring_examples(self):
"test the examples given in the docstring of ma.median"