From bbe188eeb0b87d5ea08e2f142651d9cd1de652cd Mon Sep 17 00:00:00 2001 From: pierregm Date: Sun, 30 Aug 2009 18:08:08 +0000 Subject: * Bugfix for ticket #1207 --- numpy/ma/tests/test_core.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'numpy/ma/tests') diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index dc37ff4b6..286090ad8 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -2787,6 +2787,14 @@ class TestMaskedArrayFunctions(TestCase): z = where(c, 1, masked) assert_equal(z, [99, 1, 1, 99, 99]) + def test_where_type(self): + "Test the type conservation with where" + x = np.arange(4, dtype=np.int32) + y = np.arange(4, dtype=np.float32) * 2.2 + test = where(x > 1.5, y, x).dtype + control = np.find_common_type([np.int32, np.float32], []) + assert_equal(test, control) + def test_choose(self): "Test choose" -- cgit v1.2.1