From ece0f30af3b75442f51a437948fe1a7b0a2bb014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 13 Mar 2014 18:29:54 -0400 Subject: [PATCH] Always Skip doctests which depend on Qt and are in the class doc string The doc test skip directive modifies the __doc__ attribute, which is not possible for new-stlye classes. --- skimage/viewer/plugins/base.py | 9 ++++----- skimage/viewer/viewers/core.py | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/skimage/viewer/plugins/base.py b/skimage/viewer/plugins/base.py index fb85fbde..dd3aebb0 100644 --- a/skimage/viewer/plugins/base.py +++ b/skimage/viewer/plugins/base.py @@ -16,7 +16,6 @@ else: has_qt = False -@doctest_skip_parser class Plugin(QtGui.QDialog): """Base class for plugins that interact with an ImageViewer. @@ -60,12 +59,12 @@ class Plugin(QtGui.QDialog): >>> from skimage import data >>> >>> plugin = Plugin(image_filter=lambda img, - ... threshold: img > threshold) # skip if not has_qt - >>> plugin += Slider('threshold', 0, 255) # skip if not has_qt + ... threshold: img > threshold) # doctest: +SKIP + >>> plugin += Slider('threshold', 0, 255) # doctest: +SKIP >>> >>> image = data.coins() - >>> viewer = ImageViewer(image) # skip if not has_qt - >>> viewer += plugin # skip if not has_qt + >>> viewer = ImageViewer(image) # doctest: +SKIP + >>> viewer += plugin # doctest: +SKIP >>> viewer.show() # doctest: +SKIP The plugin will automatically delegate parameters to `image_filter` based diff --git a/skimage/viewer/viewers/core.py b/skimage/viewer/viewers/core.py index 1928a178..32c10cd4 100644 --- a/skimage/viewer/viewers/core.py +++ b/skimage/viewer/viewers/core.py @@ -51,7 +51,6 @@ def mpl_image_to_rgba(mpl_image): return img_as_float(image) -@doctest_skip_parser class ImageViewer(QtGui.QMainWindow): """Viewer for displaying images. @@ -79,7 +78,7 @@ class ImageViewer(QtGui.QMainWindow): -------- >>> from skimage import data >>> image = data.coins() - >>> viewer = ImageViewer(image) # skip if not has_qt + >>> viewer = ImageViewer(image) # doctest: +SKIP >>> viewer.show() # doctest: +SKIP """