我的测试脚本如下
@pytest.fixture(scope="Module", Autouse="True")
def setup_test():
....................
yield
............
def test_1()
...............
def test_2()
...............
def test_3()
...............
Run Code Online (Sandbox Code Playgroud)
顺序脚本执行工作正常。(第一个测试设置 -> Test1 -> Test2 ->Test3 -> Tear down)使用 pytest。
如何并行运行脚本执行,例如:- 第一个测试设置 -> 并行所有测试用例 -> 拆除?
如果我在 pytest 执行中使用 -n 选项,它甚至会在设置部分完成之前并行触发所有测试,并在所有测试用例之后执行拆卸部分。
我尝试提供--dist=load选项,将安装和拆卸放入conftest文件等中。在我的情况下没有任何效果。
pytest ×1