【问题标题】:execute several times a test with pytest用 pytest 执行几次测试
【发布时间】:2013-04-14 08:48:00
【问题描述】:

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

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

类似 py.test -n100

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

【问题讨论】:

    标签: python pytest


    【解决方案1】:

    其实你可以尝试像这样使用 pytest-xdist 运行:

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

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

    【讨论】:

      猜你喜欢
      • 2022-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-08
      • 1970-01-01
      • 2019-09-18
      • 1970-01-01
      相关资源
      最近更新 更多