使用Pytest-xdist库执行分布式跑用例报错:No module named '_pytest.resultlog' 的解决方案


前言

  1.使用库:pytest 6.1.0

  2.使用库:pytest-xdist 2.2.0

 

运行分布式的测试代码:

 1 import pytest,time
 2 
 3 def test_01():
 4     time.sleep(3)
 5     print('-------test01---------')
 6 
 7 def test_02():
 8     time.sleep(3)
 9     print('-------test02---------')
10 
11 if __name__ == '__main__':
12     pytest.main(['test_xt.py','-sq','-n','6'])

 

问题:执行上面测试代码均会报以下错误:

 

解决版本:降pytest与pytest-xdist版本(我降至pytest 5.4.0 与pytest-xdist 1.3.3版本)

运行成功

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM