pytest + pytest-html skip 用例后,报错 AttributeError: ‘tuple‘ object has no attribute ‘rsplit‘

最近发现pytest框架中,skip用例后,如果生成报告就会报错,不生成报告就不会报错。
报错内容是 AttributeError: ‘tuple’ object has no attribute ‘rsplit’

就下图这样一大坨错误。
在这里插入图片描述
查来查去没发现问题,百度上也没人说过这个事。后来在Google上发现了其他人也遇到了同样的问题。
所以我记录一下,如果其他人遇到了也能百度的到这个解决方法。

其实原因就是pytest 6.0.0版本出现的bug,低版本没有这个问题。并且官方在6.0.1版本中修复了。
所以更新到6.0.1就不会存在这个问题了。

具体原因,可以参考这2篇文章
https://github.com/pytest-dev/pytest/issues/7559
https://github.com/pytest-dev/pytest-html/issues/321

猜你喜欢

转载自blog.csdn.net/tomoya_chen/article/details/108153581