Python 为什么nose在只有644权限的文件中查找测试?

Python 为什么nose在只有644权限的文件中查找测试?,python,permissions,nose,doctest,Python,Permissions,Nose,Doctest,今天,我在带有nose的Ubuntu9.10上使用Python 2.6运行了一系列doctest: nosetests --with-doctest Ran 0 tests in 0.001s OK WTF?我在那个文件里做了测试,为什么不起作用 我将权限更改为644: sudo chmod 644 * -R nosetests --with-doctest Ran 11 test in 0.004s FAILED (errors=1) 将其更改回777: sudo chmod 777

今天,我在带有nose的Ubuntu9.10上使用Python 2.6运行了一系列doctest:

nosetests --with-doctest
Ran 0 tests in 0.001s

OK
WTF?我在那个文件里做了测试,为什么不起作用

我将权限更改为644:

sudo chmod 644 * -R
nosetests --with-doctest
Ran 11 test in 0.004s

FAILED (errors=1)
将其更改回777:

sudo chmod 777 * -R
nosetests --with-doctest
Ran 0 tests in 0.001s

OK
为什么呢?使用644,我甚至不能编辑我的文件

尝试
--exe
标志:

$ nosetests --help

...    

--exe               Look for tests in python modules that are executable.
                    Normal behavior is to exclude executable modules,
                    since they may not be import-safe [NOSE_INCLUDE_EXE]

不用多说,文件的所有者就是我。哇,我在1小时前发布了这篇文章,这已经是谷歌“nose permission 644”的第一条条目了。我不知道最让我吃惊的是什么:有多少人变得出名了,或者有多少谷歌变得越来越快了。为什么你不能编辑你的文件?644==-rw-r--r--我很想理解为什么--exe不是默认行为。花了一段时间才发现这个问题!啊!