diff options
Diffstat (limited to 'nose')
-rw-r--r-- | nose/selector.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nose/selector.py b/nose/selector.py index c4a006a..dd67f52 100644 --- a/nose/selector.py +++ b/nose/selector.py @@ -8,6 +8,7 @@ thinks may be a test. """ import logging import os +import stat import unittest from nose.config import Config from nose.util import split_test_name, src, getfilename, getpackage, ispackage @@ -120,7 +121,14 @@ class Selector(object): log.debug('%s matches ignoreFiles pattern; skipped', base) return False - if not self.config.includeExe and os.access(file, os.X_OK): + + def is_executable(file): + if not os.path.exists(file): + return False + st = os.stat(file) + return bool(st.st_mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)) + + if not self.config.includeExe and is_executable(file): log.info('%s is executable; skipped', file) return False dummy, ext = op_splitext(base) |