我可以一个接一个地运行 pytest 参数化测试,如下所示
@pytest.mark.parametrize("asetup", ['a1','a2'])
@pytest.mark.parametrize("bsetup", ['b1','b2'])
这里有4个场景。我可以并行运行吗?
<Function 'test_1[b1-a1]'>
<Function 'test_1[b1-a2]'>
<Function 'test_1[b2-a1]'>
<Function 'test_1[b2-a2]'>
我尝试使用 xdist 但它仍然一个接一个地运行。
py.test -d --tx 3*popen//python=python2.7 tests_suite.py -vv -k 'test_1' -s
我scope
从更改module
为function
,但我没有看到它们并行运行。
@pytest.fixture(scope="function")