我有以下目录结构:
main/
|setup.cfg
|foo.cfg
|tests/
|setup.cfg
|foo.cfg
|test_simple.py
并测试test_simple.py
:
from nose.tools import *
from nose.config import all_config_files, user_config_files
def test_singe():
print 'all:', all_config_files()
print 'user:', user_config_files()
assert_true(False)
从main/
我跑nosetests tests/test_simple.py
,我得到:
all: ['setup.cfg']
user: []
我认为要么all_config_files
或user_config_files
将返回所有配置文件。但我只得到顶部setup.cfg
。
根据文档:
all_config_files()
Return path to any existing user config files, plus any setup.cfg
in the current working directory.
user_config_files()
Return path to any existing user config files
我希望main/tests/*.cfg
找到文件。怎么了?