TestRail的PyTest插件
pytest-testrail-plugin的Python项目详细描述
pytest testrail插件
用于与TestRail集成的PyTest插件
使用
- 在
安装 pip install pytestrail插件
在 - 在
创建配置文件.cfg
在test/testrail_config.cfg
:
[API]
url = https://cashwagon.testrail.io
email = name@cashwagon.com
password = pass
[TESTRUN]
project_id = your ID
root_section = directory_name
- 在
使用
@pytestrail.case()
装饰器进行测试
在from pytest_testrail_plugin.plugin import pytestrail
- 在
如果您想定制测试用例,请使用
^{pr2}$ 在yaml
或json
格式的docstring - 在
使用标志运行测试
py.test --testrail --tr-config=path/to/config/file.cfg
如果要删除未使用的事例和节,请使用
--tr-unsafe
标志:
在py.test --testrail --tr-config=path/to/config/file.cfg --tr-unsafe
- 项目
标签: