今天我在Ubuntu 9.10上用鼻子运行了一堆使用Python 2.6的doctests:
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,我甚至无法编辑我的文件!
答案 0 :(得分:11)
尝试--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]