diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2007-04-27 20:27:52 +0000 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2007-04-27 20:27:52 +0000 |
commit | 10a1ef8fe6b190a7c5f863f40197ac96725d3f3f (patch) | |
tree | 0e9c58b43602cb436ffdd758d2bec72af97e4660 /nose/loader.py | |
parent | 6dec83efc005af74ca7c6b37332d57da3a1ce8a6 (diff) | |
download | nose-10a1ef8fe6b190a7c5f863f40197ac96725d3f3f.tar.gz |
Fixed bugs in doctest loading from non-module files. Added functional test.
Diffstat (limited to 'nose/loader.py')
-rw-r--r-- | nose/loader.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nose/loader.py b/nose/loader.py index 47d7c2c..66962e0 100644 --- a/nose/loader.py +++ b/nose/loader.py @@ -128,9 +128,14 @@ class TestLoader(unittest.TestLoader): tests = [test for test in self.config.plugins.loadTestsFromFile(filename)] if tests: + # Plugins can yield False to indicate that they were + # unable to load tests from a file, but it was not an + # error -- the file just had no tests to load. + tests = filter(None, tests) return self.suiteClass(tests) else: - open(filename, 'r').close() # trigger os error + # Nothing was able to even try to load from this file + open(filename, 'r').close() # trigger os error raise ValueError("Unable to load tests from file %s" % filename) except KeyboardInterrupt: |