3

有没有办法用 py.test 运行 x 次测试?

我正在寻找的是多次重复测试,因为测试有随机装置。

像 py.test -n100

我一直在玩 pytest-xdist 但如果我理解得很好,它只会在 cpus 之间分配测试。

4

1 回答 1

6

实际上,您可以尝试像这样使用 pytest-xdist 运行:

py.test --dist=each --tx=3*popen

这将在三个不同的子进程中运行相同的测试 3 次。

于 2013-04-30T15:10:02.137 回答