Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add wantDirectory to ipdoctest, so that directories will be checked for e #968

Closed
wants to merge 1 commit into from

2 participants

Min RK Thomas Kluyver
Min RK
Owner

add wantDirectory to ipdoctest, so that directories will be checked for exclusion

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

closes gh-918

Min RK minrk 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
c3bd3dc
Thomas Kluyver
Owner

I'm not familiar with nose's architecture, but it looks OK (and I assume you've tested it). Although I might have used the any() function to do the same thing.

Min RK
Owner

Thanks, merging - any() does make sense, and might be trivially cleaner (though technically less efficient).

This code is just copied/pasted from directly above - it's exactly the same as the file exclusion, just in the separate method that is used for directories (which appears to be the only way to protect code in __init__).

Min RK minrk closed this pull request from a commit
Min RK minrk 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
closes gh-968
c956c22
Min RK minrk closed this in c956c22
Brian E. Granger ellisonbg referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
matthew von rocketstein mattvonrocketstein referenced this pull request from a commit in mattvonrocketstein/ipython
Min RK minrk 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
closes gh-968
e2d2de5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 2, 2011
  1. Min RK

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

    minrk authored
    …or exclusion
    
    This prevents ImportErrors raised in `__init__` checks from causing a failure when they should have been excluded.
    
    closes gh-918
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 0 deletions.
  1. +11 −0 IPython/testing/plugin/ipdoctest.py
11 IPython/testing/plugin/ipdoctest.py
View
@@ -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.
Something went wrong with that request. Please try again.