mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-18 12:40:14 +08:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user