首页 > 其他 > 详细

'CollectReport' object has no attribute 'description'

时间:2021-08-29 21:32:45      阅读:140      评论:0      收藏:0      [点我收藏+]

错误栈信息:

INTERNALERROR> File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\callers.py", line 80, in get_result
ll
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "f:\testproject\graspAutoTest\conftest.py", line 34, in pytest_html_results_table_row
INTERNALERROR> cells.insert(1, html.td(report.description))
INTERNALERROR> AttributeError: CollectReport object has no attribute description

INTERNALERROR> AttributeError: ‘CollectReport‘ object has no attribute ‘description‘

INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\_pytest\runner.py", line 217, in call_and_report
INTERNALERROR>     report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\hooks.py", line 286, in __call__  
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\manager.py", line 93, in _hookexecINTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\manager.py", line 84, in <lambda> 
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "f:\testproject\graspAutoTest\conftest.py", line 58, in pytest_runtest_makereport
INTERNALERROR>     capture_screenshots(case_name)
INTERNALERROR>   File "f:\testproject\graspAutoTest\conftest.py", line 76, in capture_screenshots
INTERNALERROR>     raise NameError(没有初始化测试报告目录)
INTERNALERROR> NameError: 没有初始化测试报告目录

NameError: 没有初始化测试报告目录

错误原因:

网上资料说是:根据错误提示,是conftest.py 里面的 函数 pytest_runtest_makereport出错了,是report不存在description属性。
有网友说是缺乏勾函数

技术分享图片

 

 

 找了几个小时根源是源代码的page页的page类有错误参数或者测试用例的源码有错误代码:

技术分享图片

 

 建议:

调试重新在新项目建立函数直接运行,能直接抛出最本质的错误原因

技术分享图片

 

'CollectReport' object has no attribute 'description'

原文:https://www.cnblogs.com/gocean/p/15196770.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!