python2.7 - 在centos下面,nose无法遍历test开头的目录或者文件?
迷茫
迷茫 2017-04-25 09:01:34
0
1
718

python的单元测试框架nose在windows下面是好用的——一个目录下有一个test文件夹,在这目录下运行nosetests,会自动遍历该test文件夹下以“test”开头的目录或者文件,进行单元测试,而到了centos下面就不行了,必须在后面跟上具体的文件,这是怎么回事呢?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
世界只因有你

First use the following command to see the files scanned by nosetest:

nosetests -vv --collect-only

I previously found through this command that some files have the executable attribute and are therefore skipped. You can see if this is your problem. If so, just remove the executable attribute.

chmod 644 xxx.py

Or execute the test directly with the exe attribute, like this:

nosetests --exe

Refer to man nosetest

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template