Merged in krw1243/nose-exclude (pull request #1)

This commit is contained in:
Kurt Grandis 2012-08-13 16:47:02 -04:00
commit 139be77eb9
2 changed files with 14 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class NoseExclude(Plugin):
if os.path.exists(abspath):
return abspath
else:
raise ValueError("invalid path: %s" % pathname)
log.warn('The following path was not found: %s' % pathname)
def _load_from_file(self, filename):
infile = open(filename)
@ -78,7 +78,8 @@ class NoseExclude(Plugin):
for d in exclude_param.split('\n'):
d = d.strip()
abs_d = self._force_to_abspath(d)
self.exclude_dirs[abs_d] = True
if abs_d:
self.exclude_dirs[abs_d] = True
exclude_str = "excluding dirs: %s" % ",".join(self.exclude_dirs.keys())
log.debug(exclude_str)

View File

@ -85,6 +85,17 @@ class TestNoseExcludeDirsEnvFile(PluginTester, unittest.TestCase):
def test_proper_dirs_omitted(self):
assert "FAILED" not in self.output
class TestNoseExcludeDirs_Arg_Does_Not_Exist(PluginTester, unittest.TestCase):
"""Test nose-exclude directories for a directory that doesn't exist.
"""
activate = "--exclude-dir=test_dirs/build"
args = ["--exclude-dir=test_dirs/test_not_me \n --exclude-dir=test_dirs/test_i_dont_exist"]
plugins = [NoseExclude()]
suitepath = os.path.join(os.getcwd(), 'test_dirs')
def test_proper_dirs_omitted(self):
assert "FAILED" not in self.output
if __name__ == '__main__':
unittest.main()