From 81805a530bd051b4319c69ff7ce4fa61cf6f5bd9 Mon Sep 17 00:00:00 2001 From: cgohlke Date: Mon, 10 Mar 2014 23:10:13 -0700 Subject: [PATCH] Skip viewer tests if no Qt API is available --- skimage/viewer/tests/test_viewer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/skimage/viewer/tests/test_viewer.py b/skimage/viewer/tests/test_viewer.py index 6b0fd48f..7fa4e374 100644 --- a/skimage/viewer/tests/test_viewer.py +++ b/skimage/viewer/tests/test_viewer.py @@ -1,7 +1,9 @@ import skimage import skimage.data as data from skimage.viewer import ImageViewer +from skimage.viewer.qt import qt_api from numpy.testing import assert_equal, assert_allclose +from numpy.testing.decorators import skipif def setup_line_profile(image): @@ -12,6 +14,7 @@ def setup_line_profile(image): return plugin +@skipif(qt_api is None) def test_line_profile(): """ Test a line profile using an ndim=2 image""" plugin = setup_line_profile(data.camera()) @@ -25,6 +28,7 @@ def test_line_profile(): assert_allclose(scan_data.mean(), 0.2828, rtol=1e-3) +@skipif(qt_api is None) def test_line_profile_rgb(): """ Test a line profile using an ndim=3 image""" plugin = setup_line_profile(data.chelsea())