Permalink
Browse files

add wantDirectory to ipdoctest, so that directories will be checked f…

…or exclusion

This prevents ImportErrors raised in `__init__` checks from causing a failure when they should have been excluded.

closes gh-918
  • Loading branch information...
1 parent dbc15c1 commit c3bd3dce73a6e4881f86baf42ea54cf3e2110c86 @minrk committed Nov 2, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 IPython/testing/plugin/ipdoctest.py
View
11 IPython/testing/plugin/ipdoctest.py
@@ -737,6 +737,17 @@ def wantFile(self,filename):
else:
return doctests.Doctest.wantFile(self,filename)
+ def wantDirectory(self, directory):
+ """Return whether the given directory should be scanned for tests.
+
+ Modified version that supports exclusions.
+ """
+
+ for pat in self.exclude_patterns:
+ if pat.search(directory):
+ return False
+ return True
+
class IPythonDoctest(ExtensionDoctest):
"""Nose Plugin that supports doctests in extension modules.

0 comments on commit c3bd3dc

Please sign in to comment.