![](/img/trans.png)
[英]How to run a single test in pytest using a complex custom id as a selector?
[英]Run a single test with multiple configs in parallel using pytest
我必須並行地對不同的主機運行相同的測試。 目前,我正在進行一堆pytest.main()調用。 但這不是並行運行的,結果不會聚合。 這是runtest.py的內容:
pytest.main('--conf=c1.txt')
pytest.main('--conf=c2.txt')
pytest.main('--conf=c3.txt')
我只有一個test_host.py,它看起來像:
test_pinghost(conf):
# pings a host in config
有沒有辦法並行運行並匯總結果? PS:配置文件只包含主機IP
請使用http://pytest.readthedocs.org/en/2.0.3/xdist.html ,它使pytest能夠跨多個進程/機器運行測試
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.