有什么方法可以设置不同的测试路径吗pytest.init文件为了我的测试。所以我可以执行类似 pytest-xx那么所有的测试用例都可以从一组多个目录执行 pytestyy那么所有的测试用例都可以从另一组多个目录执行 pytest all然后可以执行所有testcase
到目前为止。在unitA,unitB,unitC方向下进行一组测试,在回归a、回归b、回归c下进行另一组测试。所以我不需要输入 pytest unitA,unitB,unitC pytest回归a,回归b,回归c
我的pytest.ini文件. 在
[pytest]
testpaths = unitA unitB
测试路径可以作为位置参数传递给
pytest
。如果您在*nix上,可以使用shell glob扩展来匹配多个目录:pytest unit*
将被展开为pytest unitA unitB unitC
。类似地,pytest unit{A,C}
将扩展为pytest unitA unitC
。在但是,如果需要自定义测试筛选或分组逻辑,也可以定义自己的参数。例如,开关
unit-only
只运行以unit
开头的目录中的测试,忽略pytest.ini
中的testpaths
设置:相关问题 更多 >
编程相关推荐