【发布时间】:2016-04-13 09:25:16
【问题描述】:
我的目录中有以下目录结构
tests
|
|__A
| |__test_1.py
|__B
| |__test_2.py
|__C
| |__test3.py
|__D
| |__test4.py
|__test_setup
| |__conftest.py
|__pytest.ini
所以我的 pytest.ini 如下所示
[pytest]
confcutdir = tests/test_setup/
rootdir = tests/test_setup
所以我的问题是我希望 pytest 查看 conftest.py 的测试/测试设置 一种选择是将 conftest.py 保留在测试目录级别(这不是一个好的选择)
当我尝试运行时:
py.test --multihost-config=test.yaml test_1.py -q -s
它无法加载具有一堆固定装置的 conftest.py。
我做得对还是我的 pytest.ini 搞砸了?
请提出建议。 提前致谢
【问题讨论】: