From ceb2e4c5d4e861f5cbbd00b2e03b6a8d5e31af87 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sat, 12 Oct 2013 19:51:00 +0200 Subject: [PATCH] Test that output argument is utilized. --- skimage/morphology/tests/test_binary.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/skimage/morphology/tests/test_binary.py b/skimage/morphology/tests/test_binary.py index dcddc066..e1521296 100644 --- a/skimage/morphology/tests/test_binary.py +++ b/skimage/morphology/tests/test_binary.py @@ -54,5 +54,14 @@ def test_selem_overflow(): testing.assert_array_equal(binary_res, grey_res) +def test_out_argument(): + for func in (binary.binary_erosion, binary.binary_dilation): + strel = np.ones((3, 3), dtype=np.uint8) + img = np.ones((10, 10)) + out = np.zeros_like(img) + out_saved = out.copy() + func(img, strel, out=out) + testing.assert_(np.any(out != out_saved)) + if __name__ == '__main__': testing.run_module_suite()