From e624ae2f3c49b32b697cacb914bf41ba7365fdd2 Mon Sep 17 00:00:00 2001 From: marinamoore Date: Tue, 4 Dec 2018 19:54:51 -0500 Subject: [PATCH 1/3] check for regular files --- nose/selector.py | 6 ++++++ 1 file changed, 6 insertions(+) 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' From 8ae6443252f5567b16f55385b5da1647e80e9a4d Mon Sep 17 00:00:00 2001 From: marinamoore Date: Tue, 4 Dec 2018 20:08:07 -0500 Subject: [PATCH 2/3] added test for non regular files --- unit_tests/test_selector.py | 2 ++ 1 file changed, 2 insertions(+) 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(): From 82b0be9694c9d1ff92861c6e2e7e39668a51df0a Mon Sep 17 00:00:00 2001 From: marinamoore Date: Wed, 5 Dec 2018 13:29:34 -0500 Subject: [PATCH 3/3] Trigger rebuild