Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法用 py.test 运行 x 次测试?
我正在寻找的是多次重复测试,因为测试有随机装置。
像 py.test -n100
我一直在玩 pytest-xdist 但如果我理解得很好,它只会在 cpus 之间分配测试。
实际上,您可以尝试像这样使用 pytest-xdist 运行:
py.test --dist=each --tx=3*popen
这将在三个不同的子进程中运行相同的测试 3 次。