diff --git a/nose/selector.py b/nose/selector.py index b63f7af0..0a89a48b 100644 --- a/nose/selector.py +++ b/nose/selector.py @@ -7,6 +7,7 @@ thinks may be a test. """ import logging +import stat import os import unittest from nose.config import Config @@ -123,6 +124,11 @@ def wantFile(self, file): if not self.config.includeExe and is_executable(file): log.info('%s is executable; skipped', file) return False + + if os.path.exists(file) and not stat.S_ISREG((os.stat(file)).st_mode): + log.info('%s is not a regular file; skipped', file) + return False + dummy, ext = op_splitext(base) pysrc = ext == '.py' diff --git a/unit_tests/test_selector.py b/unit_tests/test_selector.py index 73e15934..bf9ceb2e 100644 --- a/unit_tests/test_selector.py +++ b/unit_tests/test_selector.py @@ -133,6 +133,8 @@ def test_want_file(self): assert not s.wantFile('test_data.txt') assert not s.wantFile('data.text') assert not s.wantFile('bar/baz/__init__.py') + + assert not s.wantFile('fifo.py') def test_want_function(self): def foo():