0
我有一个项目,我们说叫'my_project'
结构如下:包含在config.json
和tests.py
蟒蛇TOX - 没有这样的文件或目录错误
my_project
|
tox.ini
setup.py
src
|
client.py
server.py
config.json
# other files
tests.py
在文件client.py
和server.py
利用信息定义的类实现py.test
测试文件夹src中的每个文件。客户端/服务器文件里面我读的配置文件如下:
with open('./config.json') as infile:
self.parameters = json.load(infile)
接下来,我创建了一个tox.ini文件,如下所示:
[tox]
envlist = py27,cov
[testenv]
#commands = py.test --cov=src/client.py src/tests.py -v
commands = py.test -sv --doctest-modules src/__init__.py src/tests.py
[testenv:py27]
commands = coverage erase
coverage run --source=src -m pytest
coverage report -m
deps = pytest
但是当我运行tox
命令我得到一个错误:"No such file or directory: 'config.json'"
。我如何设置正确的路径以确保tox
可以找到所有必需的文件?