##// END OF EJS Templates
Slight improvements to doctest skipping....
Fernando Perez -
Show More
@@ -186,13 +186,19 b' def is_extension_module(filename):'
186 return os.path.splitext(filename)[1].lower() in ('.so','.pyd')
186 return os.path.splitext(filename)[1].lower() in ('.so','.pyd')
187
187
188
188
189 class nodoc(object):
189 class DocTestSkip(object):
190 """Object wrapper for doctests to be skipped."""
191
192 ds_skip = """Doctest to skip.
193 >>> 1 #doctest: +SKIP
194 """
195
190 def __init__(self,obj):
196 def __init__(self,obj):
191 self.obj = obj
197 self.obj = obj
192
198
193 def __getattribute__(self,key):
199 def __getattribute__(self,key):
194 if key == '__doc__':
200 if key == '__doc__':
195 return None
201 return DocTestSkip.ds_skip
196 else:
202 else:
197 return getattr(object.__getattribute__(self,'obj'),key)
203 return getattr(object.__getattribute__(self,'obj'),key)
198
204
@@ -236,7 +242,7 b' class DocTestFinder(doctest.DocTestFinder):'
236
242
237 if hasattr(obj,"skip_doctest"):
243 if hasattr(obj,"skip_doctest"):
238 #print 'SKIPPING DOCTEST FOR:',obj # dbg
244 #print 'SKIPPING DOCTEST FOR:',obj # dbg
239 obj = nodoc(obj)
245 obj = DocTestSkip(obj)
240
246
241 doctest.DocTestFinder._find(self,tests, obj, name, module,
247 doctest.DocTestFinder._find(self,tests, obj, name, module,
242 source_lines, globs, seen)
248 source_lines, globs, seen)
General Comments 0
You need to be logged in to leave comments. Login now